TenjinInc / procrastinator

Delayed task queues made simple.
https://rubygems.org/gems/procrastinator
MIT License
4 stars 0 forks source link

Determine behaviour on final_failed tasks #5

Open robinetmiller opened 8 years ago

robinetmiller commented 8 years ago

Currently, the behaviour is to keep failed and final_failed tasks for diagnosing. We could provide a syntax in setup to allow the environment to delete them instead (perhaps because the final_fail hook sends the data via email to an admin).

Procrastinator.setup(persister) do |env|
   env.define_queue(:test)

   env.delete_on_final_fail
end
robinetmiller commented 8 years ago

It really only makes sense to provide this behaviour for final_fail. If they want to delete a regular fail, that essentially makes it final anyway.