Skip to content

[5.4] Return the insertId of released jobs#18288

Merged
taylorotwell merged 1 commit intolaravel:5.4from
weotch:patch-4
Mar 9, 2017
Merged

[5.4] Return the insertId of released jobs#18288
taylorotwell merged 1 commit intolaravel:5.4from
weotch:patch-4

Conversation

@weotch
Copy link
Contributor

@weotch weotch commented Mar 9, 2017

The InteractsWithQueue trait returns the response from $this->job->release($delay); in it's release() and the DatabaseQueue class returns the inserted id from it's release() method. This allows the inserted id to flow back to a job that manually calls release().

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 the attempts after calling release().

One issue I see with this proposal is that the Job contract describes the release() response as being void, which is violated by this change.

@GrahamCampbell GrahamCampbell changed the title Return the insertId of released jobs [5.4] Return the insertId of released jobs Mar 9, 2017
@taylorotwell taylorotwell merged commit 4a9e589 into laravel:5.4 Mar 9, 2017
@taylorotwell
Copy link
Member

Can you update the contract return type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants