Przeglądaj źródła

fix(task): 修复渠道配置多个key时无法获取任务的问题

旃蒙 2 tygodni temu
rodzic
commit
0217ed2f98
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      controller/task_video.go

+ 7 - 1
controller/task_video.go

@@ -74,7 +74,13 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
 		logger.LogError(ctx, fmt.Sprintf("Task %s not found in taskM", taskId))
 		return fmt.Errorf("task %s not found", taskId)
 	}
-	resp, err := adaptor.FetchTask(baseURL, channel.Key, map[string]any{
+	key := channel.Key
+
+	privateData := task.PrivateData
+	if privateData.Key != "" {
+		key = privateData.Key
+	}
+	resp, err := adaptor.FetchTask(baseURL, key, map[string]any{
 		"task_id": taskId,
 		"action":  task.Action,
 	}, proxy)