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