MCPcopy Create free account
hub / github.com/QuantumNous/new-api / pollTaskPluginImageTask

Function pollTaskPluginImageTask

controller/plugin_protocol_image.go:209–215  ·  view source on GitHub ↗

pollTaskPluginImageTask runs one poll round for a single task through the same code path as the scheduled task poller, including status CAS and completion settlement.

(ctx context.Context, task *model.Task)

Source from the content-addressed store, hash-verified

207// same code path as the scheduled task poller, including status CAS and
208// completion settlement.
209func pollTaskPluginImageTask(ctx context.Context, task *model.Task) error {
210 upstreamID := task.GetUpstreamTaskID()
211 if upstreamID == "" {
212 return errors.New("task has no upstream id")
213 }
214 return service.UpdateVideoTasks(ctx, task.Platform, map[int][]string{task.ChannelId: {upstreamID}}, map[string]*model.Task{upstreamID: task})
215}
216
217func taskPluginImageResponseFormat(request pluginruntime.ProtocolRequestContext) string {
218 body, ok := request.Body.(map[string]any)

Callers

nothing calls this directly

Calls 2

UpdateVideoTasksFunction · 0.92
GetUpstreamTaskIDMethod · 0.80

Tested by

no test coverage detected