Skip to content

Commit

Permalink
Call activate before increment only transfer
Browse files Browse the repository at this point in the history
fixes: #61

---

Pull Request resolved: #62

Co-authored-by: tserakhau <[email protected]>
commit_hash:c1feff4678065466fbf3af703ccccefdc13f1cb4
  • Loading branch information
laskoviymishka authored and robot-piglet committed Sep 27, 2024
1 parent 6b865b5 commit 1e7869f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/trcli/replicate/replicate.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
}

0 comments on commit 1e7869f

Please sign in to comment.