rails / solid_queue

Database-backed Active Job backend
MIT License
1.95k stars 130 forks source link

Ability to Cancel a Future Scheduled Job #395

Open sesyilmaz opened 3 weeks ago

sesyilmaz commented 3 weeks ago

Hello,

We are planning to use Solid Queue to schedule tasks for future execution. However, we have some use cases where we might need to cancel enqueued jobs before they run.

While we could include logic within the job itself to check business conditions and decide whether to proceed, this approach would still consume unnecessary resources. Therefore, we would prefer the ability to cancel jobs before they execute.

Is there any plan to implement this feature? If so, what timeline would you anticipate for it?

Thanks in advance !

rosa commented 3 weeks ago

Hey @sesyilmaz, thanks for writing this question! I'm not sure I understand very well how this feature would work 🤔 As I see it, would the idea be that when the job is due for execution, Solid Queue detects it shouldn't run, and discards it? How would you specify that in a way that Solid Queue can know? I think that whatever the condition, it'd be something that consumes the same resources as if you included it in the job 🤔 I think I might be misunderstanding how you have imagined this feature to work.