From 4160ce674da3e6e860c36780b0f2eb01ecdc08dd Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Tue, 22 Nov 2016 23:14:20 +0000 Subject: [PATCH] model: consistently use cfg when referring to config instance and not package GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3755 --- lib/model/rofolder.go | 6 +++--- lib/model/rwfolder.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/model/rofolder.go b/lib/model/rofolder.go index 77f7a2be2..417dce6c1 100644 --- a/lib/model/rofolder.go +++ b/lib/model/rofolder.go @@ -22,11 +22,11 @@ type roFolder struct { folder } -func newROFolder(model *Model, config config.FolderConfiguration, _ versioner.Versioner, _ *fs.MtimeFS) service { +func newROFolder(model *Model, cfg config.FolderConfiguration, _ versioner.Versioner, _ *fs.MtimeFS) service { return &roFolder{ folder: folder{ - stateTracker: newStateTracker(config.ID), - scan: newFolderScanner(config), + stateTracker: newStateTracker(cfg.ID), + scan: newFolderScanner(cfg), stop: make(chan struct{}), model: model, }, diff --git a/lib/model/rwfolder.go b/lib/model/rwfolder.go index 1b178c739..a90682cfc 100644 --- a/lib/model/rwfolder.go +++ b/lib/model/rwfolder.go @@ -143,7 +143,7 @@ func newRWFolder(model *Model, cfg config.FolderConfiguration, ver versioner.Ver return f } -func (f *rwFolder) configureCopiersAndPullers(config config.FolderConfiguration) { +func (f *rwFolder) configureCopiersAndPullers(cfg config.FolderConfiguration) { if f.copiers == 0 { f.copiers = defaultCopiers } @@ -151,16 +151,16 @@ func (f *rwFolder) configureCopiersAndPullers(config config.FolderConfiguration) f.pullers = defaultPullers } - if config.PullerPauseS == 0 { + if cfg.PullerPauseS == 0 { f.pause = defaultPullerPause } else { - f.pause = time.Duration(config.PullerPauseS) * time.Second + f.pause = time.Duration(cfg.PullerPauseS) * time.Second } - if config.PullerSleepS == 0 { + if cfg.PullerSleepS == 0 { f.sleep = defaultPullerSleep } else { - f.sleep = time.Duration(config.PullerSleepS) * time.Second + f.sleep = time.Duration(cfg.PullerSleepS) * time.Second } }