Skip to content

Commit 0986274

Browse files
committed
Prevent jobs overlaps
1 parent a5c5c12 commit 0986274

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/Jobs/ProcessModPackFile.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Contracts\Queue\ShouldQueue;
1010
use Illuminate\Foundation\Bus\Dispatchable;
1111
use Illuminate\Queue\InteractsWithQueue;
12+
use Illuminate\Queue\Middleware\WithoutOverlapping;
1213
use Illuminate\Queue\SerializesModels;
1314
use Illuminate\Support\Facades\Storage;
1415
use Illuminate\Support\Str;
@@ -36,6 +37,16 @@ public function __construct(Modpack $modpack, string $filePath)
3637
$this->filePath = $filePath;
3738
}
3839

40+
/**
41+
* Get the middleware the job should pass through.
42+
*
43+
* @return array
44+
*/
45+
public function middleware()
46+
{
47+
return [new WithoutOverlapping($this->modpack->id)];
48+
}
49+
3950
/**
4051
* Execute the job.
4152
*

0 commit comments

Comments
 (0)