yigit / android-priority-jobqueue

A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.
3.4k stars 395 forks source link

Retry jobs are not sequential #467

Open anthony3444 opened 5 years ago

anthony3444 commented 5 years ago

Hi guys!

I have a sequential job which runs perfectly when the network is success or when the network is down (after turn on all the requests are send in the correct order). Perfect for that.

Unfortunately, when the server returns 500 for example, I do a retry for this request. But If there is a new request (in this same job, so with the same tag group), then this second can be send BEFORE the previous (which is on error, but yet in the retry process).

Is it possible to be sure, all the requests (for this job), will be send sequentially?

Ex that I want (ex: with 3 retries): Request #1 > Error 500, so retry again Request #1 > Error 500, so retry again Request #2 > stack it before the maximum retry of the previous request is not attempt Request #1 > Error 500, so retry again Request #2> Send it now !

Currently, I have: Request #1 > Error 500, so retry again Request #1 > Error 500, so retry again Request #2 > Send directly... Request #1 > Error 500, so retry again

Thanks by advance guys!

markini commented 4 years ago

Are you sure that you don't backoff #1?

Then this answer would apply: https://github.com/yigit/android-priority-jobqueue/issues/274#issuecomment-258359363