From bbb130757df1caf3f41612aee202ce57af23c4f0 Mon Sep 17 00:00:00 2001 From: Moti Asayag Date: Thu, 8 Jun 2023 12:13:42 +0300 Subject: [PATCH] Extract magic numbers to constants Signed-off-by: Moti Asayag --- .../com/redhat/parodos/sdkutils/RetryExecutorService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk-utils/src/main/java/com/redhat/parodos/sdkutils/RetryExecutorService.java b/sdk-utils/src/main/java/com/redhat/parodos/sdkutils/RetryExecutorService.java index d47bb2e5d..6be878fc3 100644 --- a/sdk-utils/src/main/java/com/redhat/parodos/sdkutils/RetryExecutorService.java +++ b/sdk-utils/src/main/java/com/redhat/parodos/sdkutils/RetryExecutorService.java @@ -11,6 +11,10 @@ public class RetryExecutorService implements AutoCloseable { + private static final int MAX_RETRY_TIME = 2 * 60 * 1000; // 2 minutes + + public static final int RETRY_DELAY = 5 * 1000; // 5 seconds + private final ScheduledExecutorService scheduledExecutor; public RetryExecutorService() { @@ -24,7 +28,7 @@ public RetryExecutorService() { */ public T submitWithRetry(Callable task) { // @formatter:off - return submitWithRetry(task, () -> {}, () -> {}, 2 * 60 * 1000, 5000); + return submitWithRetry(task, () -> {}, () -> {}, MAX_RETRY_TIME, RETRY_DELAY); // @formatter:on }