From f21f674a97f9de3d0dbd69967960bbc9eae10804 Mon Sep 17 00:00:00 2001 From: zhenggm Date: Tue, 13 Sep 2022 10:39:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=EF=BC=9A=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=92=8C=E4=B8=80=E6=AC=A1=E6=80=A7=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/bpm/web/sys/oneTimeService/OneTimeServiceFactory.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/oneTimeService/OneTimeServiceFactory.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/oneTimeService/OneTimeServiceFactory.java index 2a40de1..1ce3b32 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/oneTimeService/OneTimeServiceFactory.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/oneTimeService/OneTimeServiceFactory.java @@ -39,9 +39,6 @@ public class OneTimeServiceFactory { private OnetimeTaskHelper taskHelper = null; - //服务器编号 - private int runServer = SwConsts.SysParam.machineId; - public OneTimeServiceFactory() { } @@ -82,7 +79,7 @@ public class OneTimeServiceFactory { * @throws Exception */ public void push(String type, String key, String name, long bizId, String inparams, UserSession us) { - if (taskHelper.isExistByKey(type, key)) { + if (getTasksHelper().isExistByKey(type, key)) { throw new BizException("该任务已经存在,不能新增!"); } OnetimeTask task = new OnetimeTask(); @@ -114,7 +111,7 @@ public class OneTimeServiceFactory { * @throws Exception */ public void restart(String type, String key) { - OnetimeTask task = taskHelper.findOneByTk(type, key); + OnetimeTask task = getTasksHelper().findOneByTk(type, key); if (task != null && !task.isNew()) { schedule.schedule(new OneTimeSysService(task), 1L, TimeUnit.MILLISECONDS); } @@ -125,7 +122,7 @@ public class OneTimeServiceFactory { if (schedule != null) { stop(); } - List listService = taskHelper.findWaiting(); + List listService = getTasksHelper().findWaiting(); schedule = Executors.newScheduledThreadPool(max_thread_size); for (OnetimeTask task : listService) { schedule.schedule(new OneTimeSysService(task), 10L, TimeUnit.SECONDS);