zhangqian
2024-04-16 8b6a262a56942a1a5764526f315029f1cd410ede
api/v1/task.go
@@ -105,13 +105,12 @@
      return taskResponse.Tasks[i].Channel < taskResponse.Tasks[i].Channel
   })
   nowTs := time.Now().Unix()
   flagMap := make(map[int32]struct{}, 0)
   for _, task := range taskResponse.Tasks {
      if task.Procedure.Status != model.ProcedureStatusWaitProcess {
         continue
      }
      if _, ok := flagMap[task.Channel]; !ok && !service.TaskFlagGet(conf.Conf.CurrentDeviceID, task.Channel) && task.Procedure.StartTime <= nowTs {
      if _, ok := flagMap[task.Channel]; !ok && !service.TaskFlagGet(conf.Conf.CurrentDeviceID, task.Channel) {
         task.CanStarted = true
         flagMap[task.Channel] = struct{}{}
      }
@@ -510,10 +509,9 @@
      return
   }
   nowTs := time.Now().Unix()
   flagMap := make(map[int32]struct{}, 0)
   for _, task := range taskResponse.Tasks {
      if _, ok := flagMap[task.Channel]; !ok && !service.TaskFlagGet(conf.Conf.CurrentDeviceID, task.Channel) && task.Procedure.StartTime <= nowTs {
      if _, ok := flagMap[task.Channel]; !ok && !service.TaskFlagGet(conf.Conf.CurrentDeviceID, task.Channel) {
         task.CanStarted = true
         flagMap[task.Channel] = struct{}{}
      }