mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-12 08:45:38 +00:00
fix: task priority not taking effect
This commit is contained in:
@@ -20,10 +20,10 @@ var ErrRepoInitializationFailed = errors.New("repo initialization failed")
|
||||
var ErrPlanNotFound = errors.New("plan not found")
|
||||
|
||||
const (
|
||||
TaskPriorityDefault = iota
|
||||
TaskPriorityInteractive // higher priority than default scheduled operations e.g. the user clicked to run an operation.
|
||||
taskPriorityForget
|
||||
TaskPriorityDefault = iota
|
||||
TaskPriorityInteractive // higher priority than default scheduled operations e.g. the user clicked to run an operation
|
||||
taskPriorityIndexSnapshots // higher priority than interactive operations e.g. a system operation like a forget or index (typically scheduled by another task that wants work done immediately after it's completion).
|
||||
taskPriorityForget
|
||||
)
|
||||
|
||||
// Orchestrator is responsible for managing repos and backups.
|
||||
@@ -163,8 +163,9 @@ func (o *Orchestrator) ScheduleTask(t Task, priority int) {
|
||||
}
|
||||
zap.L().Info("scheduling task", zap.String("task", t.Name()), zap.String("runAt", nextRun.Format(time.RFC3339)))
|
||||
o.taskQueue.Push(scheduledTask{
|
||||
task: t,
|
||||
runAt: *nextRun,
|
||||
task: t,
|
||||
runAt: *nextRun,
|
||||
priority: priority,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user