Open JordanDalton opened 7 years ago
Hmm, have you actually tried this after patch? The reason I added this block - jobs would never get deleted at all so I had to do it manually.
I'm able to delete them manually afterwards.
Manually? But successful jobs should get deleted automatically?
When successful, yes. How Queue:after() was set it was deleting it regardless if was successful or not. So here's what I do as an example to control when the job gets deleted.
try {
// do something successfully
$job->delete();
} catch(Exception $e){
$job->release();
}
The documentation at https://laravel.com/docs/5.1/queues states: "... The Queue::after method allows you to register a callback to be executed when a queued job executes successfully. ..."
So Queue::after is not called if the job was not executed successfully.
Let the developer determine when the job gets deleted. If $event->job->delete() was kept jobs would be deleted regardless if handle() was successful.