Browse Source

[Fix-5886][server] Enhanced scheduler delete check (#5936)

* Add:Name verification remove the first and last spaces.

* Update: wrong word: 'WAITTING' ->'WAITING'

* Add: Strengthen verification

Co-authored-by: Squid <2824638304@qq.com>
Squidyu 3 years ago
parent
commit
1401c2e5f7

+ 2 - 2
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/quartz/ProcessScheduleJob.java

@@ -75,8 +75,8 @@ public class ProcessScheduleJob implements Job {
 
         // query schedule
         Schedule schedule = getProcessService().querySchedule(scheduleId);
-        if (schedule == null) {
-            logger.warn("process schedule does not exist in db,delete schedule job in quartz, projectId:{}, scheduleId:{}", projectId, scheduleId);
+        if (schedule == null || ReleaseState.OFFLINE == schedule.getReleaseState()) {
+            logger.warn("process schedule does not exist in db or process schedule offline,delete schedule job in quartz, projectId:{}, scheduleId:{}", projectId, scheduleId);
             deleteJob(projectId, scheduleId);
             return;
         }