从配置文件加载任务时,自定义ID避免重复从配置文件加载

This commit is contained in:
Looly
2022-06-27 20:06:12 +08:00
parent 8032f828fe
commit cbb3592a70
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -3,7 +3,7 @@
-------------------------------------------------------------------------------------------------------------
# 5.8.4.M1 (2022-06-26)
# 5.8.4.M1 (2022-06-27)
### 🐣新特性
* 【extra 】 Sftp增加构造重载,支持超时(pr#653@Gitee)
@@ -16,6 +16,7 @@
* 【core 】 LocalDateTimeUtil.parse改为blank检查(issue#I5CZJ9@Gitee)
* 【core 】 BeanPath在空元素时默认加入map,修改根据下标类型赋值List or map(issue#2362@Github)
* 【core 】 localAddressList 添加重构方法(pr#665@Gitee)
* 【cron 】 从配置文件加载任务时,自定义ID避免重复从配置文件加载(issue#I5E7BM@Gitee)
*
### 🐞Bug修复
* 【extra 】 修复createExtractor中抛出异常后流未关闭问题(pr#2384@Github)
@@ -211,7 +211,8 @@ public class Scheduler implements Serializable {
final String pattern = entry.getValue();
StaticLog.debug("Load job: {} {}", pattern, jobClass);
try {
schedule(pattern, new InvokeTask(jobClass));
// issue#I5E7BM@Gitee,自定义ID避免重复从配置文件加载
schedule("id_" + jobClass, pattern, new InvokeTask(jobClass));
} catch (Exception e) {
throw new CronException(e, "Schedule [{}] [{}] error!", pattern, jobClass);
}