mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 12:59:23 +08:00
d9081980e2
Signed-off-by: longjiquan <jiquan.long@zilliz.com> Signed-off-by: longjiquan <jiquan.long@zilliz.com>
22 lines
592 B
Go
22 lines
592 B
Go
package command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus/cmd/tools/migration/configs"
|
|
"github.com/milvus-io/milvus/cmd/tools/migration/console"
|
|
"github.com/milvus-io/milvus/cmd/tools/migration/migration"
|
|
)
|
|
|
|
func Backup(c *configs.Config) {
|
|
ctx := context.Background()
|
|
runner := migration.NewRunner(ctx, c)
|
|
console.ExitIf(runner.CheckSessions())
|
|
console.ExitIf(runner.RegisterSession())
|
|
fn := func() { runner.Stop() }
|
|
defer fn()
|
|
// double check.
|
|
console.ExitIf(runner.CheckSessions(), console.AddCallbacks(fn))
|
|
console.ExitIf(runner.Backup(), console.AddCallbacks(fn))
|
|
}
|