Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Add delay between attempts of invoking requests #398

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ public static <T> T waitAsyncResponse(FuncExecutor<T> f) throws ApiException, In
public void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders) {
log.info("onFailure {}", e.getMessage());
try {
Thread.sleep(3000);
f.execute(this);
}
catch (ApiException apie) {
catch (ApiException | InterruptedException apie) {
asyncResult.setError(apie.getMessage());
signal();
}
Expand All @@ -133,9 +134,10 @@ public void onFailure(ApiException e, int statusCode, Map<String, List<String>>
public void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders) {
if (f.check(result, statusCode)) {
try {
Thread.sleep(3000);
f.execute(this);
}
catch (ApiException apie) {
catch (ApiException | InterruptedException apie) {
asyncResult.setError(apie.getMessage());
signal();
}
Expand Down