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
When I dispatch a large batch onto the queue and then cancel it before it finishes, all of the jobs after cancelling still run. Is there a way to avoid this? I'm checking $this->batch()->cancelled() in the job, but that still results in multiple DB hits per job to inject models and run the progress hook. When I cancel, I want it to delete all the jobs with the given batch ID so they aren't even attempted, and the progress hook should not run. Can I just do this manually? (I'm using the redis queue driver.) I'm sure this has to be a solved problem.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When I dispatch a large batch onto the queue and then cancel it before it finishes, all of the jobs after cancelling still run. Is there a way to avoid this? I'm checking
$this->batch()->cancelled()
in the job, but that still results in multiple DB hits per job to inject models and run theprogress
hook. When I cancel, I want it to delete all the jobs with the given batch ID so they aren't even attempted, and theprogress
hook should not run. Can I just do this manually? (I'm using the redis queue driver.) I'm sure this has to be a solved problem.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions