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

Interface SystemTaskHandler

service/system_task.go:34–37  ·  view source on GitHub ↗

SystemTaskHandler executes a claimed task of a specific type. Run owns the task lifecycle from claim to terminal state: it MUST call model.FinishSystemTask (succeeded/failed) before returning and MUST honor ctx cancellation, which the runner triggers if the per-type lock is lost.

Source from the content-addressed store, hash-verified

32// model.FinishSystemTask (succeeded/failed) before returning and MUST honor
33// ctx cancellation, which the runner triggers if the per-type lock is lost.
34type SystemTaskHandler interface {
35 Type() string
36 Run(ctx context.Context, task *model.SystemTask, runnerID string)
37}
38
39// ScheduledSystemTaskHandler is a SystemTaskHandler that the scheduler also
40// creates periodically when enabled and the configured interval has elapsed

Callers 16

withSystemTaskRegistryFunction · 0.65
runSystemTaskClaimPassFunction · 0.65
runSystemTaskSchedulerFunction · 0.65
RedisHSetObjFunction · 0.65
RedisHGetObjFunction · 0.65
configToMapFunction · 0.65
updateConfigFromMapFunction · 0.65
mainFunction · 0.65

Implementers 6

channelTestHandlercontroller/system_task_handlers.go
modelUpdateHandlercontroller/system_task_handlers.go
midjourneyPollHandlercontroller/system_task_handlers.go
asyncTaskPollHandlercontroller/system_task_handlers.go
stubScheduledHandlerservice/system_task_test.go
logCleanupHandlerservice/system_task.go

Calls

no outgoing calls

Tested by

no test coverage detected