mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix bugs
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
|
||||
package cn.hutool.cron;
|
||||
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import cn.hutool.core.exceptions.UtilException;
|
||||
import cn.hutool.core.io.resource.NoResourceException;
|
||||
import cn.hutool.cron.pattern.CronPattern;
|
||||
@@ -11,6 +8,9 @@ import cn.hutool.cron.task.Task;
|
||||
import cn.hutool.setting.Setting;
|
||||
import cn.hutool.setting.SettingRuntimeException;
|
||||
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* 定时任务工具类<br>
|
||||
* 此工具持有一个全局{@link Scheduler},所有定时任务在同一个调度器中执行<br>
|
||||
@@ -183,7 +183,7 @@ public class CronUtil {
|
||||
}
|
||||
if (scheduler.isStarted()) {
|
||||
//关闭并清除已有任务
|
||||
scheduler.stop(true);
|
||||
stop();
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
@@ -199,7 +199,7 @@ public class CronUtil {
|
||||
* 停止
|
||||
*/
|
||||
public static void stop() {
|
||||
scheduler.stop();
|
||||
scheduler.stop(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -415,7 +415,7 @@ public class Scheduler implements Serializable {
|
||||
* 停止定时任务<br>
|
||||
* 此方法调用后会将定时器进程立即结束,如果为守护线程模式,则正在执行的作业也会自动结束,否则作业线程将在执行完成后结束。
|
||||
*
|
||||
* @param clearTasks 是否清除说有任务
|
||||
* @param clearTasks 是否清除所有任务
|
||||
* @return this
|
||||
* @since 4.1.17
|
||||
*/
|
||||
|
Reference in New Issue
Block a user