android-volley icon indicating copy to clipboard operation
android-volley copied to clipboard

how to set the retry disable?

Open autoool opened this issue 9 years ago • 1 comments

Hi, I have a project which use volley to post data to server. It work well, but I meet a problem that double request. When asicNetwork.logSlowRequests exception happened, request always retry. It lead to the server save the data which the client post twice. So , the data which server saved is wrong. How to set the retry disable? Can you give me your e-mail? It will make me contact you by email. Thank you!

autoool avatar Dec 24 '15 15:12 autoool

Hi you can use this:

yourRequest.setRetryPolicy(new DefaultRetryPolicy());

this will set timeout to 2500ms, maxRetries to 0 and backoffMultiplier to 1.0f. you can customize retry policy with the other constructor

yourRequest.setRetryPolicy(new DefaultRetryPolicy(initialTimeoutMs, maxNumRetries, backoffMultiplier));

sepbehroozi avatar Dec 26 '15 05:12 sepbehroozi