saurabhnanda / odd-jobs

Haskell job queue with admin UI and loads of other features.
https://www.haskelltutorials.com/odd-jobs/
BSD 3-Clause "New" or "Revised" License
75 stars 29 forks source link

Push failed jobs to end of the queue #73

Closed jappeace closed 3 years ago

jappeace commented 3 years ago

Order jobpollingsql by attempts first so that failed jobs go to end of the queue.

The reason is that failed jobs are likely to fail again. In our case we have some really heavy jobs that consume a lot of resources, interspersed with lighter ones. If one of the heavy job fails, it's better some other job gets a chance to run first. Odd jobs can work on that heavy one again when it's less busy (during night for example).

saurabhnanda commented 3 years ago

Good catch @jappeace . Seems to make intuitive sense to me, but want to hear what @ivb-supercede thinks?

@jappeace @ivb-supercede are both of you using odd-jobs in production?

jappeace commented 3 years ago

@saurabhnanda yes, we work for the same company

saurabhnanda commented 3 years ago

@ivanbakel @kanagarajkm @tfausak any thoughts on this PR? Will this break anything for you, by any chance?

ivanbakel commented 3 years ago

@ivb-supercede is my work account, so I am OK with these changes.

tfausak commented 3 years ago

I don't think this would break anything for me.

kanagarajkm commented 3 years ago

@saurabhnanda this looks good. i don't think it will have any impact on our project.