sorentwo / oban

💎 Robust job processing in Elixir, backed by modern PostgreSQL and SQLite3
https://getoban.pro
Apache License 2.0
3.17k stars 297 forks source link

Oban Web - support bulk actions on filtered jobs #1104

Open up2jj opened 3 weeks ago

up2jj commented 3 weeks ago

Bulk actions in Oban Web work based on the selected items. We recently struggled with a situation where the worker uniqueness settings were not correct and there were a lot of jobs arriving in the queue with the same parameters. We had to delete jobs cyclically via a manual, hand-crafted SQL query.

In addition to being able to operate on selected items, the interface should also allow actions on all filtered jobs - such as cancelling all jobs - without having to select them.

sorentwo commented 2 weeks ago

You're not the first to request this feature and it's definitely missing from the interface. It's on the list for Web v2.11

up2jj commented 2 weeks ago

@sorentwo cool, thanks! BTW, is it safe to delete rows in oban_jobs manually? I noticed that Oban.cancel_all_jobs/1 not only updates the status but it also triggers Notifier to perform some additional work.

sorentwo commented 2 weeks ago

BTW, is it safe to delete rows in oban_jobs manually?

It depends on what the jobs are and if the side-effect of deleting them would matter. The primary purpose of events for cancel_job and cancel_all_jobs is for distributed process killing, batch callbacks, etc.