refactor: encapsulate pulling in a struct

refs #10
This commit is contained in:
Christian Schwarz
2017-12-24 15:05:07 +01:00
parent 2716c75ad5
commit 583a63a68f
4 changed files with 41 additions and 21 deletions
+2 -2
View File
@@ -137,8 +137,8 @@ outer:
{
log := pullCtx.Value(contextKeyLog).(Logger)
log.Debug("replicating from lhs to rhs")
err := doPull(PullContext{local, log, j.Mapping, j.InitialReplPolicy})
if err != nil {
puller := Puller{local, log, j.Mapping, j.InitialReplPolicy}
if err := puller.doPull(); err != nil {
log.WithError(err).Error("error replicating lhs to rhs")
}
// use a ctx as soon as doPull gains ctx support