Merge pull request #8594 from Lyndon-Li/data-mover-restore-for-windows

Data mover restore for Windows
This commit is contained in:
lyndon-li
2025-01-13 13:04:29 +08:00
committed by GitHub
19 changed files with 294 additions and 102 deletions
+18 -1
View File
@@ -160,7 +160,24 @@ func newdataMoverRestore(logger logrus.FieldLogger, factory client.Factory, conf
return nil, errors.Wrap(err, "error to create client")
}
cache, err := ctlcache.New(clientConfig, cacheOption)
var cache ctlcache.Cache
retry := 10
for {
cache, err = ctlcache.New(clientConfig, cacheOption)
if err == nil {
break
}
retry--
if retry == 0 {
break
}
logger.WithError(err).Warn("Failed to create client cache, need retry")
time.Sleep(time.Second)
}
if err != nil {
cancelFunc()
return nil, errors.Wrap(err, "error to create client cache")