Sidekiq Pro callback when batch is retried?

耗尽温柔 提交于 2019-12-12 05:38:57

问题


I'm using sidekiq pro for my application, and it's been working great. But I'd like to have a way to notify my users that a failed job is being retried.

A flow would go something like this:

Batch starts worker1 runs successfully worker2 runs successfully worker3 fails oncomplete fires, stuff happens worker3 restarts ** onretry fires, notification sent to user worker 3 runs successfully onsuccess fires, stuff happens

My imaginary onretry doesn't exist in the documentation but I'm hoping there's a way to fake it. I know that I can tell if the batch has failures via the status object, but I don't see a way to get a retry event. Is there such a thing?


回答1:


The most workable approach is likely a server-side middleware which can detect a retry in progress for a batched job and send an email.



来源:https://stackoverflow.com/questions/37710594/sidekiq-pro-callback-when-batch-is-retried

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!