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

Why delete ```success``` jobs? #82

Closed hughjfchen closed 2 years ago

hughjfchen commented 3 years ago

I'm wondering why the success jobs have been deleted. Do we have a specific reason to do this? Regarding that the failed jobs would be kept into the job table, I'm really confused that. If concerning too many records in the table, we can setup a database house-keeping routine to clean up some old records. We can even create a job and run by odd-jobs itself when the database has been initialized and create a new one once it runs successfully for next cycle.

hughjfchen commented 3 years ago

I think deleting the job after having successfully finished it means the job table is treated as a transient queue. If that's the case, I believe the failed jobs also should be removed when exceeding the max attempts and permanently failed to make the semantic consistent. Currently, this behavior really makes things annoying and hard to deal with. Actually, we can't even be sure jobs has been finished successfully because we don't have records to check.