Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ProcessMaker/Jobs/BuildScriptExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use Illuminate\Queue\SerializesModels;

class BuildScriptExecutor implements ShouldQueue
Expand All @@ -18,7 +19,7 @@ class BuildScriptExecutor implements ShouldQueue
protected $userId;

// Do not retry this job if it fails
public $tries = 1;
public $tries = 20;

// Building can take some time
public $timeout = 600;
Expand All @@ -43,4 +44,12 @@ public function handle()
{
\Artisan::call('processmaker:build-script-executor ' . $this->lang . ' ' . $this->userId . ' --rebuild');
}

/**
* Prevent job overlaps
*/
public function middleware(): array
{
return [(new WithoutOverlapping())->releaseAfter(10)];
}
}