mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
bdf9eacb45
commit
328d54d986
@ -2,14 +2,13 @@ package cn.hutool.cron;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 作业启动器<br>
|
* 作业启动器<br>
|
||||||
* 负责检查<strong>TaskTable</strong>是否有匹配到此时运行的Task<br>
|
* 负责检查 {@link TaskTable} 是否有匹配到此时运行的Task<br>
|
||||||
* 检查完毕后启动器结束
|
* 检查完毕后启动器结束
|
||||||
*
|
|
||||||
* @author Looly
|
|
||||||
*
|
*
|
||||||
|
* @author Looly
|
||||||
*/
|
*/
|
||||||
public class TaskLauncher implements Runnable{
|
public class TaskLauncher implements Runnable {
|
||||||
|
|
||||||
private final Scheduler scheduler;
|
private final Scheduler scheduler;
|
||||||
private final long millis;
|
private final long millis;
|
||||||
|
|
||||||
@ -17,18 +16,18 @@ public class TaskLauncher implements Runnable{
|
|||||||
* 构造
|
* 构造
|
||||||
*
|
*
|
||||||
* @param scheduler {@link Scheduler}
|
* @param scheduler {@link Scheduler}
|
||||||
* @param millis 毫秒数
|
* @param millis 毫秒数
|
||||||
*/
|
*/
|
||||||
public TaskLauncher(Scheduler scheduler, long millis) {
|
public TaskLauncher(Scheduler scheduler, long millis) {
|
||||||
this.scheduler = scheduler;
|
this.scheduler = scheduler;
|
||||||
this.millis = millis;
|
this.millis = millis;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//匹配秒部分由用户定义决定,始终不匹配年
|
//匹配秒部分由用户定义决定,始终不匹配年
|
||||||
scheduler.taskTable.executeTaskIfMatch(this.scheduler, this.millis);
|
scheduler.taskTable.executeTaskIfMatch(this.scheduler, this.millis);
|
||||||
|
|
||||||
//结束通知
|
//结束通知
|
||||||
scheduler.taskLauncherManager.notifyLauncherCompleted(this);
|
scheduler.taskLauncherManager.notifyLauncherCompleted(this);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
* <li>{@link cn.hutool.cron.pattern.CronPattern} 定时任务表达式,用于定义任务触发时间</li>
|
* <li>{@link cn.hutool.cron.pattern.CronPattern} 定时任务表达式,用于定义任务触发时间</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
|
* 同时,提供了{@link cn.hutool.cron.CronUtil}工具类,维护一个全局的{@link cn.hutool.cron.Scheduler}。
|
||||||
|
*
|
||||||
* @author looly
|
* @author looly
|
||||||
*/
|
*/
|
||||||
package cn.hutool.cron;
|
package cn.hutool.cron;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user