DispatchPlatformUpdate 按平台分发轮询更新
(ctx context.Context, platform constant.TaskPlatform, taskChannelM map[int][]string, taskM map[string]*model.Task)
| 174 | |
| 175 | // DispatchPlatformUpdate 按平台分发轮询更新 |
| 176 | func DispatchPlatformUpdate(ctx context.Context, platform constant.TaskPlatform, taskChannelM map[int][]string, taskM map[string]*model.Task) { |
| 177 | if ctx == nil { |
| 178 | ctx = context.Background() |
| 179 | } |
| 180 | switch platform { |
| 181 | case constant.TaskPlatformMidjourney: |
| 182 | // MJ 轮询由其自身处理,这里预留入口 |
| 183 | case constant.TaskPlatformSuno: |
| 184 | _ = UpdateSunoTasks(ctx, taskChannelM, taskM) |
| 185 | default: |
| 186 | if err := UpdateVideoTasks(ctx, platform, taskChannelM, taskM); err != nil { |
| 187 | common.SysLog(fmt.Sprintf("UpdateVideoTasks fail: %s", err)) |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // UpdateSunoTasks 按渠道更新所有 Suno 任务 |
| 193 | func UpdateSunoTasks(ctx context.Context, taskChannelM map[int][]string, taskM map[string]*model.Task) error { |
no test coverage detected