Skip to content

Commit

Permalink
Merge pull request #160 from sonroyaalmerol/fix-backup
Browse files Browse the repository at this point in the history
fix backup err panic and task not returning
  • Loading branch information
sonroyaalmerol authored Feb 13, 2025
2 parents 1c32b0d + 384537b commit 933f1c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/backend/backup/jobrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func RunBackup(ctx context.Context, job *types.Job, storeInstance *store.Store,
}

// Signal that the cmd.Wait goroutine has started.
autoOp.Task = op.Task
close(autoOp.started)

// Wait for the asynchronous backup process to finish.
Expand All @@ -363,7 +364,6 @@ func RunBackup(ctx context.Context, job *types.Job, storeInstance *store.Store,
continue
}
// A backup attempt succeeded.
autoOp.Task = op.Task
autoOp.err = nil
autoOp.BackupOp = op
close(autoOp.done)
Expand Down
3 changes: 2 additions & 1 deletion internal/proxy/controllers/jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ExtJsJobRunHandler(storeInstance *store.Store) http.HandlerFunc {
op := backup.RunBackup(context.Background(), job, storeInstance, false)
if waitErr := op.WaitForStart(); waitErr != nil {
syslog.L.Error(waitErr)
controllers.WriteErrorResponse(w, err)
controllers.WriteErrorResponse(w, waitErr)
return
}
task := op.Task
Expand All @@ -74,6 +74,7 @@ func ExtJsJobRunHandler(storeInstance *store.Store) http.HandlerFunc {
response.Status = http.StatusOK
response.Success = true
json.NewEncoder(w).Encode(response)
return
}
}

Expand Down

0 comments on commit 933f1c1

Please sign in to comment.