MCPcopy
hub / github.com/QuantumNous/new-api / DispatchPlatformUpdate

Function DispatchPlatformUpdate

service/task_polling.go:176–190  ·  view source on GitHub ↗

DispatchPlatformUpdate 按平台分发轮询更新

(ctx context.Context, platform constant.TaskPlatform, taskChannelM map[int][]string, taskM map[string]*model.Task)

Source from the content-addressed store, hash-verified

174
175// DispatchPlatformUpdate 按平台分发轮询更新
176func 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 任务
193func UpdateSunoTasks(ctx context.Context, taskChannelM map[int][]string, taskM map[string]*model.Task) error {

Callers 1

RunTaskPollingOnceFunction · 0.85

Calls 2

UpdateSunoTasksFunction · 0.85
UpdateVideoTasksFunction · 0.85

Tested by

no test coverage detected