This repository was archived by the owner on Nov 24, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 437
437
}
438
438
439
439
static void createHttpClient() {
440
+ if (http != null) {
441
+ OkHttpClient.Builder builder = http.newBuilder();
442
+ if (interceptor != null)
443
+ builder.addNetworkInterceptor(interceptor);
444
+
445
+ http = builder.build();
446
+ return;
447
+ }
448
+
440
449
connectionPool = new ConnectionPool(100, 45, TimeUnit.SECONDS);
441
450
442
451
TrustManagerFactory trustManagerFactory;
748
757
end
749
758
end }
750
759
sentCount[0] += 1;
751
- if (sentCount[0] >= #{ @ast .options.retryRequest ? " 22" : " 2" } ) {
752
- return;
753
- }
754
- if (sentCount[0] >= 25) {
760
+ if (sentCount[0] >= 22) {
755
761
if (!shouldReceiveResponse[0]) return;
756
762
shouldReceiveResponse[0] = false;
757
763
timer.cancel();
763
769
});
764
770
return;
765
771
}
772
+
773
+ if (sentCount[0] >= #{ @ast .options.retryRequest ? " 22" : " 2" } ) {
774
+ return;
775
+ }
776
+
766
777
if (sentCount[0] % 4 == 0) {
767
778
createHttpClient();
768
779
}
780
+
769
781
http.newCall(request).enqueue(new okhttp3.Callback() {
770
782
@Override
771
783
public void onFailure(Call call, final IOException e) {
You can’t perform that action at this time.
0 commit comments