Skip to content

Commit

Permalink
fix: fix database in cluster
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Dec 28, 2023
1 parent 4a302d1 commit e8d4147
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pitr/cli/internal/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@ func checkDatabaseExist(proxy pkg.IShardingSphereProxy, bak *model.LsBackup) err
return xerr.NewCliErr(fmt.Sprintf("get cluster metadata failed. err: %s", err))
}

if clusterNow.MetaData.Databases == nil {
return xerr.NewCliErr(fmt.Sprintf("no cluster metadata database found. err: %s", err))
}

for k := range clusterNow.MetaData.Databases {
databaseNamesExist = append(databaseNamesExist, k)
if clusterNow != nil && clusterNow.MetaData.Databases != nil {
for k := range clusterNow.MetaData.Databases {
databaseNamesExist = append(databaseNamesExist, k)
}
}

if len(databaseNamesExist) == 0 {
Expand Down

0 comments on commit e8d4147

Please sign in to comment.