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

Function GetActiveSystemTask

model/system_task.go:132–144  ·  view source on GitHub ↗
(taskType string)

Source from the content-addressed store, hash-verified

130}
131
132func GetActiveSystemTask(taskType string) (*SystemTask, error) {
133 var task SystemTask
134 err := DB.Where("type = ? AND status IN ?", taskType, activeSystemTaskStatuses()).
135 Order("id desc").
136 First(&task).Error
137 if err != nil {
138 if errors.Is(err, gorm.ErrRecordNotFound) {
139 return nil, nil
140 }
141 return nil, err
142 }
143 return &task, nil
144}
145
146func FindPendingSystemTasks(taskType string, limit int) ([]*SystemTask, error) {
147 var tasks []*SystemTask

Calls 1

activeSystemTaskStatusesFunction · 0.85