Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[12.x] Add ability to ignore queuePaused \ queueShouldRestart cache checks#57975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@jackbayliss
Copy link
Contributor

@jackbaylissjackbayliss commentedNov 30, 2025
edited
Loading

In one of my environments, I have 7+ queue workers, each for specific use cases.

Each queue worker hits the cache to check if it should restart and if it needs to pause for each job.

Using the database cache store means this can quickly become quite heavy - as each worker hits the database. It also appears in Nightwatch a lot, which is what led me to this PR. (ie 7 workers, 2 cache keys - each job - within 24 hours- a lot of cache hits!)

image

I'm not going to be using these commands (ie restart or pause) - so it would be nice to add the option to disable them & rather than having to extend the cache manager / adjust the queue.worker singleton with some custom solution, I thought this would be nice and at least help the dx.

TLDR - cache keys are hit alot, feels like a lot of overhead if you don't use the restart/pause commands, this adds a way to turn it off.

They default to false so completely opt in, so shouldn't be any breaking changes. Happy to target 13.x if you prefer & open to feedback- thanks!

cosmastech and gutentagbomber reacted with thumbs up emojigutentagbomber and ziadoz reacted with heart emojigutentagbomber reacted with rocket emoji
@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@jackbaylissjackbaylissforce-pushed the12.x-ability-to-prevent-cache branch fromc67ff04 toec28c3dCompareNovember 30, 2025 01:37
@rodrigopedra
Copy link
Contributor

We had a similar PR (#57957) a couple of days ago that got closed.

In case you want to avoid these checks, you can try the code I added within a comment there:

#57957 (comment)

Changing theif check to something like:

if (str_starts_with($key,'illuminate:queue:')) {
jackbayliss reacted with thumbs up emoji

@cosmastech
Copy link
Contributor

Would it make sense to throw an exception in the queue pausing commands if this static property is set to false?

jackbayliss reacted with heart emoji

@jackbayliss
Copy link
ContributorAuthor

jackbayliss commentedNov 30, 2025
edited
Loading

@cosmastech Yeah, I think that makes sense 🙂

Didn't want to do too much just incase there's no interest in this, But I'll have a poke, thank you 🙏

Edit: I've poked it, but won't add them for now to prevent any scope creep, but happy for either of us / anyone to add them if this is merged / if Taylor likes the idea.

cosmastech reacted with thumbs up emoji

@jackbayliss
Copy link
ContributorAuthor

@rodrigopedra Nice one- yeah not sure. I might still try this PR just out of interest as extending it feels awkward I guess. Thank you 🙏

rodrigopedra reacted with thumbs up emoji

@jackbaylissjackbayliss marked this pull request as ready for reviewDecember 1, 2025 10:33
@taylorotwelltaylorotwell merged commite9a3727 intolaravel:12.xDec 1, 2025
74 checks passed
@rforced
Copy link

@jackbayliss any chance we can also get a doc update on how to use this? We also have heavy queues that do not pause / restart, would like to fix this so we aren't making as many cache hits.

jackbayliss reacted with thumbs up emoji

@jackbayliss
Copy link
ContributorAuthor

@rforced I'll have a poke later tonight unless someone beats me to it!

rforced reacted with heart emoji

@rforced
Copy link

@jackbayliss I ended up addingWorker::$pausable = false; to our AppServiceProvider, but Laravel Horizon complains this is deprecated. Where did you end up disabling the pause check in your app?

@jackbayliss
Copy link
ContributorAuthor

jackbayliss commentedDec 4, 2025
edited
Loading

@rforced As long as you're on the latest Laravel version it should work -see the worker class

AppServiceProvider should be fine. What's the error you get? I don't use Horizon so would be useful to know :)

Alternatively you can callQueue::withoutInterruptionPolling(); to prevent both. If that works?

@rforced
Copy link

I think we need to keep restartable enabled, we still need php artisan horizon:terminate to restart our workers (please correct me if I'm understanding this wrong)

Here is the warning from Laravel Horizon

[2025-12-03 19:17:47] local.WARNING: Creation of dynamic property Laravel\Horizon\SupervisorOptions::$pausable is deprecated in /some/path/vendor/laravel/horizon/src/SupervisorOptions.php on line 361

jackbayliss reacted with eyes emoji

@rodrigopedra
Copy link
Contributor

@rforced

I tested it on a project that uses Horizon and can't reproduce the error.

I just added:

Worker::$pausable =false;

To my project'sAppServiceProvider@boot() method.

Some questions:

  • Do you have the correctuse statement for theWorker class?
    • In that case it would beuse Illuminate\Queue\Worker;
  • What version oflaravel/framework do you have installed?
    • You can verify it by runningcomposer show --direct
    • The installed version oflaravel/framework should be at least12.41.0
jackbayliss reacted with heart emoji

@rforced
Copy link

I'm not sure what it was@rodrigopedra@jackbayliss, maybe I didn't restart a service but I'm no longer seeing that warning.
Thank you for your help guys ❤️

rodrigopedra reacted with thumbs up emojijackbayliss reacted with rocket emoji

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@jackbayliss@rodrigopedra@cosmastech@rforced@taylorotwell

[8]ページ先頭

©2009-2025 Movatter.jp