You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have, say 1000 records you want to import through remote API, it might take significant amount of time and sometimes API might be unresponsive and because it might be inaccessible for unknown period time, job throws an exception and restarts until it can proceed, so thread is not occupied by stale job.
Here is the catch, if API is unresponsive for one hour there would be ~7 retries and if after that we import some records successfully and API is unresponsive again retry_count would be equal 8 and job will have to wait ~1 hour before next try and so on, which is unoptimal.
What I want to have is ability to reset retry_count inside Worker, currently I monkey-patch RetryJob middleware in rather ugly manner:
If you have, say 1000 records you want to import through remote API, it might take significant amount of time and sometimes API might be unresponsive and because it might be inaccessible for unknown period time, job throws an exception and restarts until it can proceed, so thread is not occupied by stale job.
Here is the catch, if API is unresponsive for one hour there would be ~7 retries and if after that we import some records successfully and API is unresponsive again retry_count would be equal 8 and job will have to wait ~1 hour before next try and so on, which is unoptimal.
What I want to have is ability to reset retry_count inside Worker, currently I monkey-patch RetryJob middleware in rather ugly manner:
Ideally I would like to have something like this:
Any suggestions on how to implement this?
The text was updated successfully, but these errors were encountered: