Skip to content

Conversation

@timacdonald
Copy link
Member

@timacdonald timacdonald commented Aug 25, 2023

The JobQueued event is dispatched whenever a job has been pushed to the queue (although, not for "bulk" jobs).

The JobQueued event does expose the database's record ID, however this ID changes if a job fails and is retried.

Currently the jobs "sticky" ID - which is held in the payload - is not available.

The job's payload ID is sticky because it does not change when a job fails and is retried - however the database ID does change.

This change makes tracking the job from queued through all it's lifecycle hooks much easier. Without it...it's pretty much impossible.

* @return void
*/
protected function raiseJobQueuedEvent($jobId, $job)
protected function raiseJobQueuedEvent($jobId, $job, $payload)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically a breaking change, however I'm not sure if we expect anyone to override it.

If we are concerned about this, we use magic and just access it via func_get_args() but not have it in the method signature. We have done this before in the framework.

@timacdonald
Copy link
Member Author

Thanks, @driesvints

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.

3 participants