Files
upscayl-server/task/list.go
2026-05-21 12:51:16 +08:00

33 lines
467 B
Go

package task
import (
"sync"
)
type Status string
const (
StatusPending Status = "pending"
StatusWorking Status = "working"
StatusError Status = "error"
StatusDone Status = "done"
)
type list struct {
rw sync.RWMutex
cond *sync.Cond
Tasks []Task `json:"tasks"`
OldTasks []Task `json:"old_tasks"`
}
var taskList list
func init() {
taskList = list{
Tasks: []Task{},
OldTasks: []Task{},
}
taskList.cond = sync.NewCond(&taskList.rw)
}