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

Function TaskBulkUpdateByID

model/task.go:450–457  ·  view source on GitHub ↗

TaskBulkUpdateByID performs an unconditional bulk UPDATE by primary key IDs. WARNING: This function has NO CAS (Compare-And-Swap) guard — it will overwrite any concurrent status changes. DO NOT use in billing/quota lifecycle flows (e.g., timeout, success, failure transitions that trigger refunds or

(ids []int64, params map[string]any)

Source from the content-addressed store, hash-verified

448// (e.g., timeout, success, failure transitions that trigger refunds or settlements).
449// For status transitions that involve billing, use Task.UpdateWithStatus() instead.
450func TaskBulkUpdateByID(ids []int64, params map[string]any) error {
451 if len(ids) == 0 {
452 return nil
453 }
454 return DB.Model(&Task{}).
455 Where("id in (?)", ids).
456 Updates(params).Error
457}
458
459type TaskQuotaUsage struct {
460 Mode string `json:"mode"`

Callers 3

RunTaskPollingOnceFunction · 0.92
updateSunoTasksFunction · 0.92
updateVideoTasksFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected