Skip to content

Commit

Permalink
reset scoped instances before running a new vapor job
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Nov 4, 2024
1 parent 51fc2ef commit af06317
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ConfiguresQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Cache\NullStore;
use Illuminate\Cache\Repository;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Support\Facades\Facade;
use Laravel\Vapor\Queue\JobAttempts;
use Laravel\Vapor\Queue\VaporWorker;

Expand Down
2 changes: 2 additions & 0 deletions src/Queue/VaporWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class VaporWorker extends Worker
*/
public function runVaporJob($job, $connectionName, WorkerOptions $options)
{
app()->forgetScopedInstances();

pcntl_async_signals(true);

pcntl_signal(SIGALRM, function () use ($job) {
Expand Down

0 comments on commit af06317

Please sign in to comment.