[5.4] Return the insertId of released jobs #18288
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
InteractsWithQueue
trait returns the response from$this->job->release($delay);
in it'srelease()
and theDatabaseQueue
class returns the inserted id from it'srelease()
method. This allows the inserted id to flow back to a job that manually callsrelease()
.My use case involves wanting to release a job back onto the queue without incrementing it's attempts count. I would use this to manually query the
jobs
table and decrement theattempts
after callingrelease()
.One issue I see with this proposal is that the
Job
contract describes therelease()
response as beingvoid
, which is violated by this change.