Skip to content

Commit

Permalink
Merge pull request #54 from sonroyaalmerol/remove-passthrough-proxy
Browse files Browse the repository at this point in the history
initializing monitor before starting the backup process
  • Loading branch information
sonroyaalmerol authored Jan 11, 2025
2 parents 45dfe3f + 70c2f91 commit a4bdd57
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/backend/backup/jobrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ func RunBackup(job *store.Job, storeInstance *store.Store) (*store.Task, error)
defer stdout.Close()
defer stderr.Close()

// Start the backup process first
if err := cmd.Start(); err != nil {
return nil, fmt.Errorf("RunBackup: proxmox-backup-client start error (%s): %w", cmd.String(), err)
}

// Create task monitoring channel with buffer to prevent goroutine leak
taskChan := make(chan store.Task, 1)

Expand All @@ -301,6 +296,11 @@ func RunBackup(job *store.Job, storeInstance *store.Store) (*store.Task, error)
task, monitorErr = monitorTask(monitorCtx, storeInstance, job, taskChan)
}()

// Start the backup process first
if err := cmd.Start(); err != nil {
return nil, fmt.Errorf("RunBackup: proxmox-backup-client start error (%s): %w", cmd.String(), err)
}

// Wait for either monitoring to complete or timeout
select {
case <-monitorDone:
Expand Down

0 comments on commit a4bdd57

Please sign in to comment.