diff --git a/app/Browser/BrowserJob.php b/app/Browser/BrowserJob.php index f0797ab..a055c1c 100644 --- a/app/Browser/BrowserJob.php +++ b/app/Browser/BrowserJob.php @@ -2,6 +2,7 @@ namespace App\Browser; +use App\Models\Job; use App\Models\JobArtifact; use App\Models\JobRun; use Closure; @@ -27,12 +28,14 @@ abstract class BrowserJob implements ShouldQueue use SupportsChrome, ProvidesBrowser, Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public int $jobId; + public Job $job; public $timeout = 500; public function __construct(int $jobId) { $this->jobId = $jobId; + $this->job = Job::find($jobId); } /** @@ -216,7 +219,9 @@ abstract class BrowserJob implements ShouldQueue */ public function handle(): void { - $this->execute(); + if ($this->job->is_active) { + $this->execute(); + } } public function reschedule($minutes) {