Skip to content

Commit

Permalink
Fix issue not dispatch sync handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
hotmeteor committed Oct 27, 2022
1 parent a84947f commit 6210aa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Providers/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Receiver\Providers;

use Closure;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Foundation\Bus\PendingDispatch;
use Illuminate\Http\JsonResponse;
Expand Down Expand Up @@ -160,7 +161,9 @@ protected function handle(): void
if (class_exists($class)) {
$instance = new $class($event, $this->webhook->getData(), $this->webhook);

$this->dispatched = dispatch($instance);
$this->dispatched = $instance instanceof ShouldQueue
? dispatch($instance)
: dispatch_sync($instance);
}
}

Expand Down

0 comments on commit 6210aa7

Please sign in to comment.