Skip to content

Commit

Permalink
Prevent jobs overlaps
Browse files Browse the repository at this point in the history
  • Loading branch information
leohubert committed Aug 13, 2022
1 parent a5c5c12 commit 0986274
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/Jobs/ProcessModPackFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -36,6 +37,16 @@ public function __construct(Modpack $modpack, string $filePath)
$this->filePath = $filePath;
}

/**
* Get the middleware the job should pass through.
*
* @return array
*/
public function middleware()
{
return [new WithoutOverlapping($this->modpack->id)];
}

/**
* Execute the job.
*
Expand Down

0 comments on commit 0986274

Please sign in to comment.