From 1e7869f256c1768adae4961e1ff396b498cb1abd Mon Sep 17 00:00:00 2001 From: tserakhau Date: Fri, 27 Sep 2024 15:07:48 +0300 Subject: [PATCH] Call activate before increment only transfer fixes: #61 --- Pull Request resolved: https://github.com/doublecloud/transfer/pull/62 Co-authored-by: tserakhau commit_hash:c1feff4678065466fbf3af703ccccefdc13f1cb4 --- cmd/trcli/replicate/replicate.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/trcli/replicate/replicate.go b/cmd/trcli/replicate/replicate.go index 91253634..8fba7aac 100644 --- a/cmd/trcli/replicate/replicate.go +++ b/cmd/trcli/replicate/replicate.go @@ -1,6 +1,9 @@ package replicate import ( + "time" + + "github.com/doublecloud/transfer/cmd/trcli/activate" "github.com/doublecloud/transfer/cmd/trcli/config" "github.com/doublecloud/transfer/internal/logger" "github.com/doublecloud/transfer/library/go/core/metrics/solomon" @@ -31,6 +34,11 @@ func replicate(cp *coordinator.Coordinator, rt abstract.Runtime, transferYaml *s return xerrors.Errorf("unable to load transfer: %w", err) } transfer.Runtime = rt + if transfer.IncrementOnly() { + if err := activate.RunActivate(*cp, transfer); err != nil { + return xerrors.Errorf("unable to activate transfer: %w", err) + } + } return RunReplication(*cp, transfer) } @@ -50,5 +58,6 @@ func RunReplication(cp coordinator.Coordinator, transfer *model.Transfer) error logger.Log.Warnf("unable to stop worker: %v", err) } logger.Log.Warnf("worker failed: %v, restart", err) + time.Sleep(10 * time.Second) } }