action-scheduler icon indicating copy to clipboard operation
action-scheduler copied to clipboard

Disable with a constant

Open Mte90 opened this issue 3 years ago • 4 comments
trafficstars

So to achieve that you need to use a filter but in the automated tests world this means that you need a WP instance already available.

There is https://github.com/woocommerce/action-scheduler-disable-default-runner that use that filter and let to disable it but it isn't more simple to have a constant that you can disable on the wp-config.php?

Mte90 avatar Sep 16 '22 09:09 Mte90

Hi @Mte90,

I could certainly see the value in that. I'll mark this as a low priority enhancement and, if you wish, you could submit a PR to add this and we'll be happy to review.

barryhughes avatar Sep 20 '22 20:09 barryhughes

So is not a difficult PR https://github.com/woocommerce/action-scheduler/search?q=action_scheduler_run_queue but what is the name that you prefer for the constant? So I do everything once :-)

Mte90 avatar Sep 21 '22 10:09 Mte90

I don't believe we currently define or look for any top-level constants (except for some that are defined by WordPress or WP CLI), so there isn't really any precedent to look at, but I would propose:

AS_DISABLE_QUEUE_RUNNERS

What do you think?

barryhughes avatar Sep 21 '22 14:09 barryhughes

PR done :-)

Mte90 avatar Sep 21 '22 14:09 Mte90