|
16 | 16 |
|
17 | 17 | package com.github.fonimus.ssh.shell.commands;
|
18 | 18 |
|
19 |
| -import com.github.fonimus.ssh.shell.SimpleTable; |
20 |
| -import com.github.fonimus.ssh.shell.SshShellHelper; |
21 |
| -import com.github.fonimus.ssh.shell.SshShellProperties; |
22 | 19 | import lombok.AllArgsConstructor;
|
23 | 20 | import lombok.Data;
|
24 | 21 | import lombok.NoArgsConstructor;
|
25 | 22 | import lombok.extern.slf4j.Slf4j;
|
| 23 | + |
| 24 | +import java.lang.reflect.Method; |
| 25 | +import java.time.Duration; |
| 26 | +import java.time.ZoneOffset; |
| 27 | +import java.time.format.DateTimeFormatter; |
| 28 | +import java.util.ArrayList; |
| 29 | +import java.util.Collection; |
| 30 | +import java.util.Date; |
| 31 | +import java.util.HashMap; |
| 32 | +import java.util.List; |
| 33 | +import java.util.Map; |
| 34 | +import java.util.Set; |
| 35 | +import java.util.UUID; |
| 36 | +import java.util.concurrent.Executors; |
| 37 | +import java.util.concurrent.ScheduledFuture; |
| 38 | +import java.util.stream.Collectors; |
| 39 | + |
26 | 40 | import org.springframework.beans.factory.DisposableBean;
|
27 | 41 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
28 | 42 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
50 | 64 | import org.springframework.shell.standard.ValueProviderSupport;
|
51 | 65 | import org.springframework.stereotype.Component;
|
52 | 66 |
|
53 |
| -import java.lang.reflect.Method; |
54 |
| - |
55 |
| -import java.time.Duration; |
56 |
| -import java.time.ZoneOffset; |
57 |
| -import java.time.format.DateTimeFormatter; |
58 |
| -import java.util.*; |
59 |
| -import java.util.concurrent.Executors; |
60 |
| -import java.util.concurrent.ScheduledFuture; |
61 |
| -import java.util.stream.Collectors; |
| 67 | +import com.github.fonimus.ssh.shell.SimpleTable; |
| 68 | +import com.github.fonimus.ssh.shell.SshShellHelper; |
| 69 | +import com.github.fonimus.ssh.shell.SshShellProperties; |
62 | 70 |
|
63 | 71 | import static org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.DEFAULT_TASK_SCHEDULER_BEAN_NAME;
|
64 | 72 |
|
@@ -323,7 +331,7 @@ public String tasksSingle(
|
323 | 331 | try {
|
324 | 332 | String executionId = taskName + "-" + generateExecutionId();
|
325 | 333 | // Will run the Runnable immediately or as soon as possible
|
326 |
| - ScheduledFuture<?> future = taskScheduler.schedule(state.getScheduledTask().getTask().getRunnable(), new Date()); |
| 334 | + ScheduledFuture<?> future = taskScheduler().schedule(state.getScheduledTask().getTask().getRunnable(), new Date()); |
327 | 335 | statesByName.put(executionId, new TaskState(executionId, null, TaskStatus.running, future));
|
328 | 336 | started.add(executionId);
|
329 | 337 | } catch (TaskRejectedException e) {
|
|
0 commit comments