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

Method ToResponse

model/system_task.go:432–447  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

430}
431
432func (task *SystemTask) ToResponse() SystemTaskResponse {
433 return SystemTaskResponse{
434 ID: task.ID,
435 TaskID: task.TaskID,
436 Type: task.Type,
437 Status: task.Status,
438 ActiveKey: task.ActiveKey,
439 Payload: decodeSystemTaskJSONValue(task.Payload),
440 State: decodeSystemTaskJSONValue(task.State),
441 Result: decodeSystemTaskJSONValue(task.Result),
442 Error: task.Error,
443 LockedBy: task.LockedBy,
444 CreatedAt: task.CreatedAt,
445 UpdatedAt: task.UpdatedAt,
446 }
447}
448
449func activeSystemTaskStatuses() []string {
450 return []string{string(SystemTaskStatusPending), string(SystemTaskStatusRunning)}

Callers 5

GetCurrentSystemTaskFunction · 0.45
ListSystemTasksFunction · 0.45
GetSystemTaskFunction · 0.45
ListSystemInstancesFunction · 0.45

Calls 1

Tested by

no test coverage detected