parent
d8729a7c67
commit
3c05679a97
|
|
@ -212,10 +212,9 @@ public class ConcurrentTaskScheduler extends ConcurrentTaskExecutor implements T
|
|||
|
||||
@Override
|
||||
public ScheduledFuture<?> schedule(Runnable task, Instant startTime) {
|
||||
Duration initialDelay = Duration.between(this.clock.instant(), startTime);
|
||||
Duration delay = Duration.between(this.clock.instant(), startTime);
|
||||
try {
|
||||
return this.scheduledExecutor.schedule(decorateTask(task, false),
|
||||
NANO.convert(initialDelay), NANO);
|
||||
return this.scheduledExecutor.schedule(decorateTask(task, false), NANO.convert(delay), NANO);
|
||||
}
|
||||
catch (RejectedExecutionException ex) {
|
||||
throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
|
||||
|
|
|
|||
|
|
@ -383,10 +383,9 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
|
|||
@Override
|
||||
public ScheduledFuture<?> schedule(Runnable task, Instant startTime) {
|
||||
ScheduledExecutorService executor = getScheduledExecutor();
|
||||
Duration initialDelay = Duration.between(this.clock.instant(), startTime);
|
||||
Duration delay = Duration.between(this.clock.instant(), startTime);
|
||||
try {
|
||||
return executor.schedule(errorHandlingTask(task, false),
|
||||
NANO.convert(initialDelay), NANO);
|
||||
return executor.schedule(errorHandlingTask(task, false), NANO.convert(delay), NANO);
|
||||
}
|
||||
catch (RejectedExecutionException ex) {
|
||||
throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
|
||||
|
|
|
|||
Loading…
Reference in New Issue