Skip to content

Commit 8cb6480

Browse files
committed
feat: add Init before AddInstance while backing up
Signed-off-by: mlycore <miaoliyao@apache.org>
1 parent 081b0bb commit 8cb6480

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pitr/agent/internal/handler/backup.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ func Backup(ctx *fiber.Ctx) error {
4545
return fmt.Errorf(efmt, in.Username, len(in.Password), in.DBName, err)
4646
}
4747

48+
if err := pkg.OG.Init(in.DnBackupPath); err != nil {
49+
return fmt.Errorf("init instance failed, err: %w", err)
50+
}
51+
4852
// try to add backup instance
4953
if err := pkg.OG.AddInstance(in.DnBackupPath, in.Instance); err != nil && !errors.Is(err, cons.InstanceAlreadyExist) {
5054
return fmt.Errorf("add instance failed, err wrap: %w", err)

0 commit comments

Comments
 (0)