Skip to content

Commit 8c74536

Browse files
committed
Revert "test exponential backoff"
This reverts commit 2876877.
1 parent 2876877 commit 8c74536

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/main/java/io/digdag/plugin/slack/SlackOperatorFactory.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
import okhttp3.Call;
1414
import okhttp3.FormBody;
1515
import okhttp3.Interceptor;
16-
import okhttp3.MediaType;
1716
import okhttp3.OkHttpClient;
1817
import okhttp3.Request;
1918
import okhttp3.RequestBody;
2019
import okhttp3.Response;
21-
import okhttp3.ResponseBody;
2220

2321
import java.io.IOException;
2422
import java.util.Arrays;
25-
import java.util.logging.Logger;
2623

2724
import static java.nio.charset.StandardCharsets.UTF_8;
2825

@@ -123,13 +120,10 @@ static class RetryInterceptor implements Interceptor
123120
public Response intercept(Chain chain) throws IOException
124121
{
125122
Request request = chain.request();
126-
// Response response = chain.proceed(request);
127-
Response response = new Response.Builder().code(503).message("503 Service Unavailable").body(ResponseBody.create(MediaType.parse("application/json; charset=utf-8"), "{}")).protocol(okhttp3.Protocol.HTTP_1_1).request(request).build();
123+
Response response = chain.proceed(request);
128124
int retryCount = 0;
129-
Logger logger = Logger.getLogger(RetryInterceptor.class.getName());
130125
while (!response.isSuccessful() && retryCount < MAX_RETRY_COUNT && Arrays.asList(retryHttpStatus).contains(response.code())) {
131126
retryCount++;
132-
logger.info("Retry count: " + retryCount);
133127

134128
response.close();
135129
try {
@@ -138,8 +132,7 @@ public Response intercept(Chain chain) throws IOException
138132
e.printStackTrace();
139133
}
140134
// retry request
141-
// response = chain.proceed(request);
142-
response = new Response.Builder().code(503).message("503 Service Unavailable").body(ResponseBody.create(MediaType.parse("application/json; charset=utf-8"), "{}")).protocol(okhttp3.Protocol.HTTP_1_1).request(request).build();
135+
response = chain.proceed(request);
143136
}
144137
return response;
145138
}

0 commit comments

Comments
 (0)