fix: condition snapshot start hook may not run if repo is unreachable and autounlock is enabled

This commit is contained in:
Gareth
2026-03-10 22:44:08 -07:00
parent 7344541588
commit cd72b7f8a9
+4 -4
View File
@@ -142,10 +142,6 @@ func (t *BackupTask) Run(ctx context.Context, st ScheduledTask, runner TaskRunne
return notifyError(err)
}
if err := repo.UnlockIfAutoEnabled(ctx); err != nil {
return notifyError(fmt.Errorf("auto unlock repo %q: %w", t.RepoID(), err))
}
plan, err := runner.GetPlan(t.PlanID())
if err != nil {
return notifyError(err)
@@ -157,6 +153,10 @@ func (t *BackupTask) Run(ctx context.Context, st ScheduledTask, runner TaskRunne
return notifyError(fmt.Errorf("snapshot start hook: %w", err))
}
if err := repo.UnlockIfAutoEnabled(ctx); err != nil {
return notifyError(fmt.Errorf("auto unlock repo %q: %w", t.RepoID(), err))
}
var sendWg sync.WaitGroup
lastSent := time.Now() // debounce progress updates, these can endup being very frequent.
var lastFiles []string