[BUGFIX] Respect changed stopIfNecessary() signature
#34
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.
\Illuminate\Queue\Worker::stopIfNecessary()method signature has changed from
to
between
7.xand8.xof depending packageilluminate/queue[1][2] and a valid breakingchange between major versions.
The changed signature has not been respected and
mitigated with allowing
illuminate/queue:8.x,leading to following exception in case a interop
is used:
To mitigate the error, this change:
Modifies
\Enqueue\LaravelQueue\Workerto track thestart_timeand the number ofprocessedjobs withan configured interop, mainly in
Worker:deamon()and
Worker::runNextJob().Modifies
Worker::onPostMessageReceived()to callstopIfNecessary()passing the job as last argumentand providing the new inbetween options to mitigate
the error message.
This package
enqueue/laravel-queuechanged thesupported versions of the dependency package
illuminate/queueonpatchlevelreleases andconsiderable violating semver and making it now
impossible to release this fix for the target
version with older
illuminate/queueconstraints.Following versions would need fixes also changing
the illuminate/queue constraints:
Adding additional major version support of dependencies
is not considerable breaking, and not respecting the
method change can be taken as
bug. However, droppingmajor version support of dependencies is considerable
breaking and must have gained a
majorversionbump for this package already.
The fix can now only be made on top, not fixing it for
the older releases and consumers requiring the fix with
illuminate/queueversions^8.0 | ^9.0 | ^10.0.[1] laravel/framework#33449
[2] laravel/framework@441a85a