forked from loafle/openapi-generator-original
[android] volley socket timeout configurable (#3646)
* [android] volley socket timeout configurable * Updated Android Volley Petstore sample
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package {{invokerPackage}};
|
||||
|
||||
import com.android.volley.Cache;
|
||||
import com.android.volley.DefaultRetryPolicy;
|
||||
import com.android.volley.Network;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
@@ -486,7 +487,12 @@ public class ApiInvoker {
|
||||
} else {
|
||||
request = new PatchRequest(url, headers, null, null, stringRequest, errorListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (request != null) {
|
||||
request.setRetryPolicy(new DefaultRetryPolicy((int)TimeUnit.SECONDS.toMillis(this.connectionTimeout), DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user