This is an automated email from the ASF dual-hosted git repository.

miaoliyao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shardingsphere-on-cloud.git


The following commit(s) were added to refs/heads/main by this push:
     new 8cb6480  feat: add Init before AddInstance while backing up
     new 7600684  Merge pull request #480 from mlycore/fix-init
8cb6480 is described below

commit 8cb648088ee0d9dfd2f488c2d5bca453a2fcfe28
Author: mlycore <[email protected]>
AuthorDate: Fri Dec 15 17:40:39 2023 +0800

    feat: add Init before AddInstance while backing up
    
    Signed-off-by: mlycore <[email protected]>
---
 pitr/agent/internal/handler/backup.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pitr/agent/internal/handler/backup.go 
b/pitr/agent/internal/handler/backup.go
index dfb1d29..2ab95a4 100644
--- a/pitr/agent/internal/handler/backup.go
+++ b/pitr/agent/internal/handler/backup.go
@@ -45,6 +45,10 @@ func Backup(ctx *fiber.Ctx) error {
                return fmt.Errorf(efmt, in.Username, len(in.Password), 
in.DBName, err)
        }
 
+       if err := pkg.OG.Init(in.DnBackupPath); err != nil {
+               return fmt.Errorf("init instance failed, err: %w", err)
+       }
+
        // try to add backup instance
        if err := pkg.OG.AddInstance(in.DnBackupPath, in.Instance); err != nil 
&& !errors.Is(err, cons.InstanceAlreadyExist) {
                return fmt.Errorf("add instance failed, err wrap: %w", err)

Reply via email to