2 Commits

Author SHA1 Message Date
e44ea5a3b2 Fix queue wotker
All checks were successful
Push image to registry / build-image (push) Successful in 3m46s
2025-02-21 18:34:19 +01:00
a4d52e3f88 Logging and only one job in the queue 2025-02-21 18:34:03 +01:00
2 changed files with 8 additions and 5 deletions

View File

@ -4,7 +4,6 @@ namespace App\Browser\Jobs\Hellcase;
use App\Browser\BrowserJob;
use App\Browser\Components\Hellcase\MainNav;
use App\Browser\JobArtifacts\JobRunArtifact;
use App\Browser\Jobs\Hellcase\HellcaseLoginQrCode;
use App\Models\JobArtifact;
use App\Models\JobRun;
@ -13,12 +12,12 @@ use App\Notification\NotificationBody\Hellcase\HellcaseNotificationLoginBody;
use App\Notification\Notifications\Hellcase\HellcaseNotificationDailyFree;
use App\Notification\Notifications\Hellcase\HellcaseNotificationLogin;
use App\Notification\Providers\AllNotification;
use Dom\XPath;
use Facebook\WebDriver\WebDriverBy;
use Illuminate\Support\Facades\Schedule;
use Illuminate\Contracts\Queue\ShouldBeUniqueUntilProcessing;
use Illuminate\Support\Facades\Log;
use Laravel\Dusk\Browser;
class HellcaseJob extends BrowserJob
class HellcaseJob extends BrowserJob implements ShouldBeUniqueUntilProcessing
{
private const STEAM_LOGIN_THRESHOLD = 5 * 60; // 5 minutes
@ -26,11 +25,13 @@ class HellcaseJob extends BrowserJob
public function __construct()
{
Log::info("Constructing HellcaseJob");
parent::__construct(2);
}
public function run(Browser $browser): ?JobRun
{
Log::info("Running HellcaseJob");
$this->jobRun = new JobRun([
"job_id" => $this->jobId,
"success" => false,
@ -48,6 +49,8 @@ class HellcaseJob extends BrowserJob
$this->jobRun->success = true;
$this->jobRun->save();
Log::info("HellcaseJob run ended");
return $this->jobRun;
}

View File

@ -1,6 +1,6 @@
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work --queue=high,default --tries=3 --timeout=300 --sleep=3 --no-interaction
command=php /var/www/artisan queue:work --queue=high,default --tries=3 --timeout=300 --sleep=3 --no-interaction --max-time=3600 --max-jobs=1
autostart=true
autorestart=true
stopasgroup=true