Skip to content

Commit 509a1ef

Browse files
committed
feat: convinience method to reschedule with duration (#1325)
1 parent d6428a3 commit 509a1ef

File tree

1 file changed

+6
-0
lines changed
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler

1 file changed

+6
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/BaseControl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.javaoperatorsdk.operator.api.reconciler;
22

3+
import java.time.Duration;
34
import java.util.Optional;
45
import java.util.concurrent.TimeUnit;
56

@@ -12,6 +13,11 @@ public T rescheduleAfter(long delay) {
1213
return (T) this;
1314
}
1415

16+
public T rescheduleAfter(Duration delay) {
17+
this.scheduleDelay = delay.toMillis();
18+
return (T) this;
19+
}
20+
1521
public T rescheduleAfter(long delay, TimeUnit timeUnit) {
1622
return rescheduleAfter(timeUnit.toMillis(delay));
1723
}

0 commit comments

Comments
 (0)