mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix: wait for idle network before taking screenshots
This commit is contained in:
parent
ba9def7d4b
commit
4b32f3e8b2
1 changed files with 2 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ class ImageGenerationService
|
|||
try {
|
||||
BrowsershotLambda::html($markup)
|
||||
->windowSize(800, 480)
|
||||
->waitUntilNetworkIdle()
|
||||
->save($pngPath);
|
||||
} catch (Exception $e) {
|
||||
Log::error('Failed to generate PNG: '.$e->getMessage());
|
||||
|
|
@ -40,6 +41,7 @@ class ImageGenerationService
|
|||
Browsershot::html($markup)
|
||||
->setOption('args', config('app.puppeteer_docker') ? ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu'] : [])
|
||||
->windowSize(800, 480)
|
||||
->waitUntilNetworkIdle()
|
||||
->save($pngPath);
|
||||
} catch (Exception $e) {
|
||||
Log::error('Failed to generate PNG: '.$e->getMessage());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue