mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-12 16:26:37 +00:00
model: consistently use cfg when referring to config instance and not package
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3755
This commit is contained in:
parent
2dbeea21c4
commit
4160ce674d
@ -22,11 +22,11 @@ type roFolder struct {
|
|||||||
folder
|
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{
|
return &roFolder{
|
||||||
folder: folder{
|
folder: folder{
|
||||||
stateTracker: newStateTracker(config.ID),
|
stateTracker: newStateTracker(cfg.ID),
|
||||||
scan: newFolderScanner(config),
|
scan: newFolderScanner(cfg),
|
||||||
stop: make(chan struct{}),
|
stop: make(chan struct{}),
|
||||||
model: model,
|
model: model,
|
||||||
},
|
},
|
||||||
|
@ -143,7 +143,7 @@ func newRWFolder(model *Model, cfg config.FolderConfiguration, ver versioner.Ver
|
|||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *rwFolder) configureCopiersAndPullers(config config.FolderConfiguration) {
|
func (f *rwFolder) configureCopiersAndPullers(cfg config.FolderConfiguration) {
|
||||||
if f.copiers == 0 {
|
if f.copiers == 0 {
|
||||||
f.copiers = defaultCopiers
|
f.copiers = defaultCopiers
|
||||||
}
|
}
|
||||||
@ -151,16 +151,16 @@ func (f *rwFolder) configureCopiersAndPullers(config config.FolderConfiguration)
|
|||||||
f.pullers = defaultPullers
|
f.pullers = defaultPullers
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.PullerPauseS == 0 {
|
if cfg.PullerPauseS == 0 {
|
||||||
f.pause = defaultPullerPause
|
f.pause = defaultPullerPause
|
||||||
} else {
|
} 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
|
f.sleep = defaultPullerSleep
|
||||||
} else {
|
} else {
|
||||||
f.sleep = time.Duration(config.PullerSleepS) * time.Second
|
f.sleep = time.Duration(cfg.PullerSleepS) * time.Second
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user