From cd72b7f8a94f830cf0a1365547d1ac47bc37a738 Mon Sep 17 00:00:00 2001 From: Gareth Date: Tue, 10 Mar 2026 22:44:08 -0700 Subject: [PATCH] fix: condition snapshot start hook may not run if repo is unreachable and autounlock is enabled --- internal/orchestrator/tasks/taskbackup.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/orchestrator/tasks/taskbackup.go b/internal/orchestrator/tasks/taskbackup.go index 1de1c03f..70eeb560 100644 --- a/internal/orchestrator/tasks/taskbackup.go +++ b/internal/orchestrator/tasks/taskbackup.go @@ -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