Skip to content

Commit

Permalink
Merge pull request #481 from mlycore/fix-init-path
Browse files Browse the repository at this point in the history
fix: init will not return err if path exists
  • Loading branch information
strongduanmu authored Dec 18, 2023
2 parents 586c058 + 1a8e600 commit 829f4b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pitr/agent/internal/pkg/opengauss.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ func (og *openGauss) Init(backupPath string) error {
og.log.Debug(fmt.Sprintf("Init output[msg=%s,err=%v]", output, err))

if errors.Is(err, cons.CmdOperateFailed) {
og.log.Error(fmt.Sprintf("init backup path failure,err: %s, wrap: %s", err, cons.BackupPathAlreadyExist))
if strings.Contains(err.Error(), "backup catalog already exist and it's not empty") {
og.log.Error(fmt.Sprintf("init backup path failure,err: %s, wrap: %s", err, cons.BackupPathAlreadyExist))
return nil
}

return err
}
if err != nil {
Expand Down

0 comments on commit 829f4b8

Please sign in to comment.