From 94df71bfd6882893efcafb0fd89a6acfe0c158a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Tue, 2 Sep 2025 13:16:50 +0200 Subject: [PATCH] improve: duration for initial interval in GenericRetry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../operator/processing/retry/GenericRetry.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java index a8e1c5b466..9b42971e7c 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java @@ -1,5 +1,7 @@ package io.javaoperatorsdk.operator.processing.retry; +import java.time.Duration; + import io.javaoperatorsdk.operator.api.config.AnnotationConfigurable; public class GenericRetry implements Retry, AnnotationConfigurable { @@ -40,6 +42,11 @@ public long getInitialInterval() { return initialInterval; } + public GenericRetry setInitialInterval(Duration initialInterval) { + setInitialInterval(initialInterval.toMillis()); + return this; + } + public GenericRetry setInitialInterval(long initialInterval) { this.initialInterval = initialInterval; return this;