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

View File

@@ -120,8 +120,8 @@ start:
log.Info("starting pull")
pullLog := log.WithField(logTaskField, "pull")
err = doPull(PullContext{client, pullLog, j.Mapping, j.InitialReplPolicy})
if err != nil {
puller := Puller{client, pullLog, j.Mapping, j.InitialReplPolicy}
if err = puller.doPull(); err != nil {
log.WithError(err).Error("error doing pull")
}