felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.23k stars 354 forks source link

Support pausing a worker even when worker is actively processing a job #803

Open alkiskal opened 2 weeks ago

alkiskal commented 2 weeks ago

BullMQ supports pausing a queue, which bull-board uses

https://github.com/search?q=repo%3Afelixmosh%2Fbull-board%20%22.pause(%22&type=code

This option is not forcing the pause, meaning, if we try to pause queue that has a job currently being processed, it will wait for it to finish. This limits force/disaster situations where a job needs to be aborted from execution, without bringing the system to a halt (e.g. needing to cause a restart just to have enough time to remove the job) or needing to interact with redis directly.

BullMQ support this by calling the pause directly to the worker await myWorker.pause(true); https://docs.bullmq.io/guide/workers/pausing-queues

It would be an amazing feature to be able to force pause the worker.

felixmosh commented 2 weeks ago

Thank you for the feature request. Currently bull-board not interacting with the workers at all... It will require some infra for that.

Will you be able to make a Pr for it?

alkiskal commented 2 weeks ago

I'll need to be acquainted with the code, but I believe I can manage. A question before doing so. This is not supported in bull, so it won't be available. How do you approach this kind of functionality? Do you only allow functionality to be added if it's available for both or diverging slightly is acceptable?