Compare commits
2 Commits
e44ea5a3b2
...
540c41357e
Author | SHA1 | Date | |
---|---|---|---|
540c41357e | |||
9f7603ea18 |
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Browser;
|
namespace App\Browser;
|
||||||
|
|
||||||
|
use App\Models\Job;
|
||||||
use App\Models\JobArtifact;
|
use App\Models\JobArtifact;
|
||||||
use App\Models\JobRun;
|
use App\Models\JobRun;
|
||||||
use Closure;
|
use Closure;
|
||||||
@ -27,12 +28,14 @@ abstract class BrowserJob implements ShouldQueue
|
|||||||
use SupportsChrome, ProvidesBrowser, Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use SupportsChrome, ProvidesBrowser, Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
public int $jobId;
|
public int $jobId;
|
||||||
|
public Job $job;
|
||||||
|
|
||||||
public $timeout = 500;
|
public $timeout = 500;
|
||||||
|
|
||||||
public function __construct(int $jobId)
|
public function __construct(int $jobId)
|
||||||
{
|
{
|
||||||
$this->jobId = $jobId;
|
$this->jobId = $jobId;
|
||||||
|
$this->job = Job::find($jobId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -216,7 +219,9 @@ abstract class BrowserJob implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$this->execute();
|
if ($this->job->is_active) {
|
||||||
|
$this->execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reschedule($minutes) {
|
public function reschedule($minutes) {
|
||||||
|
@ -6,6 +6,9 @@ php ./artisan migrate --force
|
|||||||
# Cache
|
# Cache
|
||||||
php ./artisan optimize:clear && php ./artisan optimize
|
php ./artisan optimize:clear && php ./artisan optimize
|
||||||
|
|
||||||
|
# Scheduler
|
||||||
|
crond -b -L /dev/stdout
|
||||||
|
|
||||||
# Queue worker
|
# Queue worker
|
||||||
supervisord --nodaemon --configuration /etc/supervisord.conf &
|
supervisord --nodaemon --configuration /etc/supervisord.conf &
|
||||||
supervisorctl start "laravel-worker:*"
|
supervisorctl start "laravel-worker:*"
|
||||||
|
Reference in New Issue
Block a user