Skip to content

Commit

Permalink
Fix queue->after expecting wrong event
Browse files Browse the repository at this point in the history
  • Loading branch information
tobytwigger committed Aug 28, 2022
1 parent aeb2cbb commit 609dc7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/JobStatusServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Bus\Dispatcher as LaravelDispatcher;
use Illuminate\Contracts\Container\Container;
use Illuminate\Queue\Events\JobExceptionOccurred;
use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Queue\Events\JobProcessing;
use Illuminate\Queue\QueueManager;
use Illuminate\Support\Facades\Route;
Expand Down Expand Up @@ -50,7 +51,7 @@ public function mapQueueEventListeners()
/** @var QueueManager $queueManager */
$queueManager = app('queue');
$queueManager->before(fn (JobProcessing $event) => $ifTracked($event->job, fn () => $event->job->setJobStatus('started')));
$queueManager->after(fn (JobProcessing $event) => $ifTracked($event->job, fn () => $event->job->setJobStatus('finished')));
$queueManager->after(fn (JobProcessed $event) => $ifTracked($event->job, fn () => $event->job->setJobStatus('finished')));
$queueManager->before(fn (JobProcessing $event) => $ifTracked($event->job, fn () => $event->job->setPercentage(100)));
$queueManager->exceptionOccurred(fn (JobExceptionOccurred $event) => $ifTracked(
$event->job,
Expand Down

0 comments on commit 609dc7d

Please sign in to comment.