Skip to content

Commit

Permalink
Use Timer identifier when rescheduling the timer (#3095)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
  • Loading branch information
cweitkamp authored Sep 29, 2022
1 parent 6d6250e commit 93a8a21
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public TimerImpl(Scheduler scheduler, ZonedDateTime startTime, SchedulerRunnable
this(scheduler, startTime, runnable, null);
}

public TimerImpl(Scheduler scheduler, ZonedDateTime startTime, SchedulerRunnable runnable, @Nullable String identifier) {
public TimerImpl(Scheduler scheduler, ZonedDateTime startTime, SchedulerRunnable runnable,
@Nullable String identifier) {
this.scheduler = scheduler;
this.startTime = startTime;
this.runnable = runnable;
Expand All @@ -57,7 +58,7 @@ public boolean cancel() {
@Override
public synchronized boolean reschedule(ZonedDateTime newTime) {
future.cancel(false);
future = scheduler.schedule(runnable, newTime.toInstant());
future = scheduler.schedule(runnable, identifier, newTime.toInstant());
return true;
}

Expand Down

0 comments on commit 93a8a21

Please sign in to comment.