ScheduleManager优化
This commit is contained in:
@@ -162,7 +162,7 @@ public class ScheduleManagerService implements ScheduleManager, Service {
|
|||||||
} while ((clazz = clazz.getSuperclass()) != Object.class);
|
} while ((clazz = clazz.getSuperclass()) != Object.class);
|
||||||
//开始执行定时任务
|
//开始执行定时任务
|
||||||
if (enabled && !tasks.isEmpty()) {
|
if (enabled && !tasks.isEmpty()) {
|
||||||
tasks.forEach((name, task) -> task.start());
|
tasks.forEach((name, task) -> task.init());
|
||||||
refTaskMap.put(ref, new ArrayList<>(tasks.values()));
|
refTaskMap.put(ref, new ArrayList<>(tasks.values()));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -360,6 +360,10 @@ public class ScheduleManagerService implements ScheduleManager, Service {
|
|||||||
this.event = method.getParameterCount() == 0 ? null : new ScheduleEvent();
|
this.event = method.getParameterCount() == 0 ? null : new ScheduleEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void start();
|
public abstract void start();
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
|
|||||||
Reference in New Issue
Block a user