Revert observer-wide after-commit; keep saved() job hook.
PostCreated already waits for commit via ShouldDispatchAfterCommit. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
52f6506b3c
commit
254b7d514b
1 changed files with 2 additions and 3 deletions
|
|
@ -9,9 +9,8 @@
|
|||
use App\Events\PostCreated;
|
||||
use App\Jobs\Automation\DispatchPostTriggerAutomationsJob;
|
||||
use App\Models\Post;
|
||||
use Illuminate\Contracts\Events\ShouldHandleEventsAfterCommit;
|
||||
|
||||
class PostObserver implements ShouldHandleEventsAfterCommit
|
||||
class PostObserver
|
||||
{
|
||||
public function created(Post $post): void
|
||||
{
|
||||
|
|
@ -34,6 +33,6 @@ public function saved(Post $post): void
|
|||
return;
|
||||
}
|
||||
|
||||
DispatchPostTriggerAutomationsJob::dispatch($post, $triggerType);
|
||||
DispatchPostTriggerAutomationsJob::dispatch($post, $triggerType)->afterCommit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue