humanmade / Cavalcade

A better wp-cron. Horizontally scalable, works perfectly with multisite.
https://engineering.hmn.md/projects/cavalcade/
Other
519 stars 46 forks source link

[Feature Request] Option to run single tasks sync on staging/local environments #56

Closed martijn94 closed 6 years ago

martijn94 commented 6 years ago

Hi Ryan/Humanmade

First of all thanks for creating this, have been looking for something like this for a while to have better job/queue management.

Coming from Laravel I have the feature request to run tasks sync on local/staging environments for easier development/debugging.

An other workaround suggestion would also be appreciated!

Thanks!

rmccue commented 6 years ago

Hi, thanks for the feedback!

What exactly is the use case for this? At a guess, you'd like to monitor exactly what a job is doing when in development to test output/etc? If so, the best option might be to schedule a job, but stop the Runner. This lets you run jobs individually by using wp cavalcade run <id> (in multisite, you'll need to pass the right --url for the site too).

It's unlikely that we'll add a synchronous mode, as it kind of breaks the encapsulation of jobs; we run jobs through wp-cli specifically to ensure they're running in a clean environment.

martijn94 commented 6 years ago

Fail enough, makes sense. Thanks!