|
| 1 | +/* |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +contributor license agreements. See the NOTICE file distributed with this |
| 4 | +work for additional information regarding copyright ownership. The ASF |
| 5 | +licenses this file to You under the Apache License, Version 2.0 (the |
| 6 | +"License"); you may not use this file except in compliance with the License. |
| 7 | +You may obtain a copy of the License at |
| 8 | +
|
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +Unless required by applicable law or agreed to in writing, software |
| 12 | +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +License for the specific language governing permissions and limitations |
| 15 | +under the License. |
| 16 | +*/ |
| 17 | + |
1 | 18 | package schedules |
2 | 19 |
|
3 | 20 | import ( |
4 | 21 | "errors" |
| 22 | + "vermeer/apps/common" |
5 | 23 | "vermeer/apps/structure" |
6 | 24 |
|
7 | 25 | "github.com/sirupsen/logrus" |
@@ -86,6 +104,10 @@ func (t *SchedulerTaskManager) RefreshTaskToWorkerGroupMap() { |
86 | 104 | * @Return error |
87 | 105 | */ |
88 | 106 | func (t *SchedulerTaskManager) AddTaskStartSequence(taskID int32) error { |
| 107 | + if common.GetConfig("debug_mode").(string) != "debug" { |
| 108 | + logrus.Warn("TaskStartSequence called but debug features are disabled") |
| 109 | + return nil |
| 110 | + } |
89 | 111 | if _, exists := t.allTaskMap[taskID]; !exists { |
90 | 112 | return errors.New("task not found") |
91 | 113 | } |
@@ -202,7 +224,7 @@ func (t *SchedulerTaskManager) GetAllTasksNotComplete() []*structure.TaskInfo { |
202 | 224 | return tasks |
203 | 225 | } |
204 | 226 |
|
205 | | -func (t *SchedulerTaskManager) GetAllTasksWaitng() []*structure.TaskInfo { |
| 227 | +func (t *SchedulerTaskManager) GetAllTasksWaiting() []*structure.TaskInfo { |
206 | 228 | tasks := make([]*structure.TaskInfo, 0, len(t.allTaskMap)) |
207 | 229 | for _, task := range t.GetAllTasksNotComplete() { |
208 | 230 | if task.State == structure.TaskStateWaiting { |
|
0 commit comments