任务调度修改

This commit is contained in:
2025-03-23 17:45:38 +08:00
parent a8601548c6
commit a5f67b1eac
3 changed files with 14 additions and 2 deletions

View File

@ -53,4 +53,6 @@ public interface TaskMapper {
TaskEntity get(Long taskId);
List<TaskEntity> listEntity(TaskReqQuery taskReqQuery);
List<TaskRespVO> selectNotRunningByScenicId(Long scenicOnly);
}

View File

@ -185,7 +185,12 @@ public class TaskTaskServiceImpl implements TaskService {
try {
if (lock.tryLock(2, TimeUnit.SECONDS)) {
try {
List<TaskRespVO> taskList = taskMapper.selectNotRunning();
List<TaskRespVO> taskList;
if (worker.getScenicOnly() != null) {
taskList = taskMapper.selectNotRunningByScenicId(worker.getScenicOnly());
} else {
taskList = taskMapper.selectNotRunning();
}
resp.setTasks(taskList);
resp.setTemplates(updTemplateList);
taskList.forEach(task -> {