Skip to content

Commit d55e5f3

Browse files
committed
Fix S3 retry logging messages
1 parent cf20163 commit d55e5f3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/org/radarbase/output/source/S3SourceStorage.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,14 @@ class S3SourceStorage(
118118
) {
119119
throw FileNotFoundException()
120120
}
121-
logger.warn("Temporarily failed to do S3 operation: {}", ex.toString())
122121
if (i < 2) {
123-
logger.warn("Temporarily failed to do S3 operation: {}, retrying after 1 second.", ex.toString())
124-
Thread.sleep((i + 1) * 1000L)
122+
val timeout = i + 1
123+
logger.warn(
124+
"Temporarily failed to do S3 operation: {}, retrying after {} second(s).",
125+
ex.toString(),
126+
timeout,
127+
)
128+
Thread.sleep(timeout * 1000L)
125129
} else {
126130
logger.error("Failed to do S3 operation: {}", ex.toString())
127131
exception = ex

0 commit comments

Comments
 (0)