mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-30 04:45:55 +08:00
fix cron
This commit is contained in:
parent
f341b9ed7a
commit
fe2516b646
@ -13,6 +13,7 @@
|
||||
package org.dromara.hutool.cron;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUnit;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.log.Log;
|
||||
|
||||
@ -63,9 +64,14 @@ public class CronTimer extends Thread implements Serializable {
|
||||
//等待直到下一个时间点,如果被中断直接退出Timer
|
||||
break;
|
||||
}
|
||||
|
||||
//执行点,时间记录为执行开始的时间,而非结束时间
|
||||
thisTime = System.currentTimeMillis();
|
||||
spawnLauncher(thisTime);
|
||||
spawnLauncher(nextTime);
|
||||
|
||||
// issue#3460 采用叠加方式,确保正好是1分钟或1秒,避免sleep晚醒问题
|
||||
// 此处无需校验,因为每次循环都是sleep与上触发点的时间差。
|
||||
// 当上一次晚醒后,本次会减少sleep时间,保证误差在一个unit内,并不断修正。
|
||||
thisTime = nextTime;
|
||||
} else{
|
||||
// 非正常时间重新计算(issue#1224@Github)
|
||||
thisTime = System.currentTimeMillis();
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
# demo.org.dromara.hutool.cron.TestJob.doTest = */1 * * * * *
|
||||
|
||||
[org.dromara.hutool.cron.demo]=
|
||||
[org.dromara.hutool.cron.demo]
|
||||
# 6位表达式在秒匹配模式下可用,此处表示每秒执行一次
|
||||
# TestJob.doTest = */1 * * * * *
|
||||
# 5位表达式在分匹配模式下可用,此处表示每分钟执行一次
|
||||
|
@ -38,7 +38,7 @@
|
||||
<druid.version>1.2.21</druid.version>
|
||||
<!-- 固定4.x -->
|
||||
<hikariCP.version>4.0.3</hikariCP.version>
|
||||
<sqlite.version>3.43.0.0</sqlite.version>
|
||||
<sqlite.version>3.44.1.0</sqlite.version>
|
||||
<!-- 此处固定2.5.x,支持到JDK8 -->
|
||||
<hsqldb.version>2.5.2</hsqldb.version>
|
||||
</properties>
|
||||
|
@ -32,7 +32,7 @@
|
||||
<Automatic-Module-Name>org.dromara.hutool.extra</Automatic-Module-Name>
|
||||
<!-- versions -->
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<beetl.version>3.15.8.RELEASE</beetl.version>
|
||||
<beetl.version>3.15.12.RELEASE</beetl.version>
|
||||
<rythm.version>1.4.2</rythm.version>
|
||||
<freemarker.version>2.3.32</freemarker.version>
|
||||
<enjoy.version>5.1.3</enjoy.version>
|
||||
@ -415,7 +415,7 @@
|
||||
<dependency>
|
||||
<groupId>com.rnkrsoft.bopomofo4j</groupId>
|
||||
<artifactId>bopomofo4j</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -496,7 +496,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.24.0</version>
|
||||
<version>1.25.0</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
@ -504,7 +504,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>6.4.5</version>
|
||||
<version>6.4.10</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
@ -32,10 +32,10 @@
|
||||
<Automatic-Module-Name>org.dromara.hutool.log</Automatic-Module-Name>
|
||||
<!-- versions -->
|
||||
<slf4j.version>2.0.9</slf4j.version>
|
||||
<logback.version>1.4.13</logback.version>
|
||||
<logback.version>1.4.14</logback.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<log4j2.version>2.20.0</log4j2.version>
|
||||
<commons-logging.version>1.2</commons-logging.version>
|
||||
<commons-logging.version>1.3.0</commons-logging.version>
|
||||
<tinylog.version>1.3.6</tinylog.version>
|
||||
<tinylog2.version>2.6.2</tinylog2.version>
|
||||
<!-- 固定3.4.x,支持到jdk8 -->
|
||||
|
Loading…
Reference in New Issue
Block a user