You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am dispatching a lot of jobs inside a workflow. To avoid race conditions and overload, I want to prevent overlap of jobs that work on the same resource (let's say an external database). I have tried to set the WithoutOverlapping middleware on the job (see Laravel docs), but it does not seem to work as intended.
I have put a debug log inside the middleware() method of the job, and it never gets called when dispatched from inside the workflow. However, if I dispatch manually the job on its own, the method is called (the debug log shows up).
It seems to show that job middleware is ignored when used in a workflow.
The text was updated successfully, but these errors were encountered:
I'm unable to reproduce this. Can you set up a small repository that illustrates the bug? What queue connection are you using and how are you starting the workflow?
@ksassnowski oddly enough, making my workflow job implement Sassnowski\Venture\WorkflowableJob (instead of relying only on Illuminate\Contracts\Queue\ShouldQueue and the WorkflowStep trait) made things work as intended. 🤔
Yes, all jobs in a workflow should implement this interface. Jobs that don't implement the interface are deprecated and are only kept around for BC reasons support for them will be dropped in the next major version. What you are describing sounds like a bug in the adapter Venture internally uses to wrap jobs that don't implement the interface.
Hello! 👋🏻
I am dispatching a lot of jobs inside a workflow. To avoid race conditions and overload, I want to prevent overlap of jobs that work on the same resource (let's say an external database). I have tried to set the
WithoutOverlapping
middleware on the job (see Laravel docs), but it does not seem to work as intended.I have put a debug log inside the
middleware()
method of the job, and it never gets called when dispatched from inside the workflow. However, if I dispatch manually the job on its own, the method is called (the debug log shows up).It seems to show that job middleware is ignored when used in a workflow.
The text was updated successfully, but these errors were encountered: