Skip to content

Conversation

jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Sep 26, 2025

My DB and app are managed by different companies.

My DB sometimes has maintenance, at which point I schedule the app to go into maintenance during those hours- but the workers always still try to get the cache as they're restarted by the managed provider, regardless of maintenance mode etc.

This is due to getTimestampOfLastQueueRestart which results in me seeing loads of:

SQLSTATE[HY000] [2002] Connection refused (Connection: mysql, SQL: select * from `cache` where `key` in (app_cache_illuminate:foundation:down))

This PR basically makes the queue worker fail gracefully - and exit when the cache is unavailable, but still report the error.

I've also added the ability to also alter the cache exit code, like $memoryExceededExitCode

I've targeted 12.x as I don't think it's a breaking change, but can change it to target 13.x if i'm missing something..

Feel free to adjust etc, as maybe there's a better solution. 🫡

Thank you!

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.

@jackbayliss jackbayliss marked this pull request as ready for review September 26, 2025 15:36
@taylorotwell
Copy link
Member

I probably won't change this behavior on a patch release.

@jackbayliss
Copy link
Contributor Author

@taylorotwell Thanks, I'll target 13.x once the other worker bits are eventually merged into main.

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