Skip to content

Commit

Permalink
fix: init will not return err if path exists
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Dec 18, 2023
1 parent 7600684 commit 1a8e600
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 1a8e600

Please sign in to comment.