Skip to content

Conversation

@jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Dec 1, 2025

Off the back of #57975 - I thought it would be useful to add these error messages (which came to mind by the Exception suggestion by @cosmastech 🙏🏻 )

I've used messages as feels more command like than an exception.

This just means the commands can't run - cache keys aren't set etc if we know they're not going to be used as we've explicitly turned them off in the Worker

I've also added a return type to the restart command, so it's clear and follows elsewhere (such as the cache clear command)

Any suggestions let me know!

Cheers.

for pause,restart and resume commands
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

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 December 1, 2025 18:19
@jackbayliss jackbayliss marked this pull request as draft December 1, 2025 18:26
@jackbayliss jackbayliss changed the title [12.x] Add runtime exceptions to Resume, Restart & Pause commands [12.x] Add error message to Resume, Restart & Pause commands when disabling worker cache Dec 1, 2025
@jackbayliss jackbayliss marked this pull request as ready for review December 1, 2025 18:31
if (! Worker::$pausable) {
$this->components->error('Worker::$pausable must be set to true to use this command.');

return 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've left this as 1 - as its returning 0 down below. I'll probably do another PR to normalize them all to use self::SUCCESS / FAILURE if this is merged 🤷🏻

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.

1 participant