LLM reel caption and video description + Refactor in services

This commit is contained in:
2025-06-30 16:14:29 +02:00
parent 21abbcdff5
commit 228d67a48d
20 changed files with 575 additions and 151 deletions

View File

@ -33,7 +33,7 @@ abstract class BrowserJob implements ShouldQueue
public int $jobId;
public $timeout = 500;
public $timeout = 300; // 5 minutes
public function __construct(int $jobId)
{
@ -53,6 +53,7 @@ abstract class BrowserJob implements ShouldQueue
$this->browse(function (Browser $browser) use ($callback, &$log) {
try {
$browser->driver->manage()->timeouts()->implicitlyWait(20);
$log = $callback($browser);
// } catch (Exception $e) {
// $browser->screenshot("failure-{$this->jobId}");
@ -160,7 +161,7 @@ abstract class BrowserJob implements ShouldQueue
'--disable-setuid-sandbox',
'--whitelisted-ips=""',
'--disable-dev-shm-usage',
'--user-data-dir=/home/seluser/profile/',
'--user-data-dir=/home/seluser/profile/nigga/', // seems that selenium doesn't like docker having a volume on the exact same folder ("session not created: probably user data directory is already in use")
])->all());
return RemoteWebDriver::create(
@ -168,7 +169,12 @@ abstract class BrowserJob implements ShouldQueue
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY,
$options
),
)
->setCapability('timeouts', [
'implicit' => 20000, // 20 seconds
'pageLoad' => 300000, // 5 minutes
'script' => 30000, // 30 seconds
]),
4000,
$this->timeout * 1000
);