Skip to content

Commit 750c870

Browse files
author
Josh Deffibaugh
committed
Use milliseconds instead of seconds for thread sleeping
1 parent f070505 commit 750c870

File tree

1 file changed

+2
-1
lines changed
  • shared/src/main/java/com/optimizely/ab/android/shared

1 file changed

+2
-1
lines changed

shared/src/main/java/com/optimizely/ab/android/shared/Client.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.net.URL;
2828
import java.net.URLConnection;
2929
import java.util.Scanner;
30+
import java.util.concurrent.TimeUnit;
3031

3132
/**
3233
* Functionality common to all clients
@@ -115,7 +116,7 @@ public <T> T execute(Request<T> request, int timeout, int power) {
115116
if (response == null || response == Boolean.FALSE) {
116117
try {
117118
logger.info("Request failed, waiting {} seconds to try again", timeout);
118-
Thread.sleep(timeout);
119+
Thread.sleep(TimeUnit.MILLISECONDS.convert(timeout, TimeUnit.SECONDS));
119120
} catch (InterruptedException e) {
120121
logger.warn("Exponential backoff failed", e);
121122
break;

0 commit comments

Comments
 (0)