Skip to content

Commit

Permalink
wait for either context or taskchan
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Nov 18, 2024
1 parent 3ba429e commit 3c8c962
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/backend/backup/jobrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ func RunBackup(job *store.Job, storeInstance *store.Store, waitChan chan struct{
}

log.Printf("Waiting for task: %s\n", job.ID)
<-taskChan

select {
case <-taskChan:
case <-watchCtx.Done():
}

if task == nil {
return nil, fmt.Errorf("RunBackup: task not found")
Expand Down

0 comments on commit 3c8c962

Please sign in to comment.