Fix job event and scope handling #351
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.
This should fix #342.
There is only 1 edge case left. When running the
syncdriver and nesting queued jobs (dispatching a queue job from a dispatched job) only the scope data of the last job started is captured, this is only and issue on thesyncdriver (which is not a production driver, but a development one) so I'm personally fine with this.This should work great bot in daemon mode and just
queue:workmode.I have tried a whole evening to test this, but there is no way without actually running an app and a queue worker to emulate it correctly so I do not want to add half-assed tests, this might be revisited later. I validated this works by just trying to break it using a scratch Laravel app and it seems to be working.