From 18f887e3796143f7438f249284139e0e8b692c78 Mon Sep 17 00:00:00 2001 From: khanhtc1202 Date: Tue, 5 Jul 2022 14:04:17 +0700 Subject: [PATCH] Add running log for migration task runner --- pkg/app/ops/platformprovidermigration/runner.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/app/ops/platformprovidermigration/runner.go b/pkg/app/ops/platformprovidermigration/runner.go index f87a206ba9..6b50435cb2 100644 --- a/pkg/app/ops/platformprovidermigration/runner.go +++ b/pkg/app/ops/platformprovidermigration/runner.go @@ -16,6 +16,7 @@ package platformprovidermigration import ( "context" + "fmt" "time" "go.uber.org/zap" @@ -51,10 +52,13 @@ func (r *Runner) Migrate(ctx context.Context) error { // Run migration task once on start this ops migration. cursor, err := r.migrate(ctx, "") - if err != nil { - r.logger.Error("unable to finish application platform provider migration task in first run", zap.Error(err)) + if err == nil { + r.logger.Info("application migration task finished successfully") + return nil } + r.logger.Error("unable to finish application platform provider migration task in first run", zap.Error(err)) + taskRunTicker := time.NewTicker(migrationRunInterval) defer taskRunTicker.Stop() @@ -110,6 +114,8 @@ func (r *Runner) migrate(ctx context.Context, cursor string) (string, error) { return "", nil } + r.logger.Info(fmt.Sprintf("migrate platform provider value for %d application(s)", len(apps))) + for _, app := range apps { if app.PlatformProvider != "" { continue