Make parallel hasher configurable, remove finisher setting (fixes #1199)

This commit is contained in:
Audrius Butkevicius
2014-12-24 23:12:12 +00:00
parent 5d173168cc
commit 5827a686b8
5 changed files with 20 additions and 19 deletions

View File

@@ -190,7 +190,6 @@ func (m *Model) StartFolderRW(folder string) {
progressEmitter: m.progressEmitter,
copiers: cfg.Copiers,
pullers: cfg.Pullers,
finishers: cfg.Finishers,
queue: newJobQueue(),
}
m.folderRunners[folder] = p
@@ -1138,6 +1137,7 @@ func (m *Model) ScanFolderSub(folder, sub string) error {
TempLifetime: time.Duration(m.cfg.Options().KeepTemporariesH) * time.Hour,
CurrentFiler: cFiler{m, folder},
IgnorePerms: folderCfg.IgnorePerms,
Hashers: folderCfg.Hashers,
}
m.setState(folder, FolderScanning)

View File

@@ -77,7 +77,6 @@ type Puller struct {
progressEmitter *ProgressEmitter
copiers int
pullers int
finishers int
queue *jobQueue
}
@@ -258,7 +257,7 @@ func (p *Puller) pullerIteration(ignores *ignore.Matcher) int {
var doneWg sync.WaitGroup
if debug {
l.Debugln(p, "c", p.copiers, "p", p.pullers, "f", p.finishers)
l.Debugln(p, "c", p.copiers, "p", p.pullers)
}
for i := 0; i < p.copiers; i++ {
@@ -279,14 +278,12 @@ func (p *Puller) pullerIteration(ignores *ignore.Matcher) int {
}()
}
for i := 0; i < p.finishers; i++ {
doneWg.Add(1)
// finisherRoutine finishes when finisherChan is closed
go func() {
p.finisherRoutine(finisherChan)
doneWg.Done()
}()
}
doneWg.Add(1)
// finisherRoutine finishes when finisherChan is closed
go func() {
p.finisherRoutine(finisherChan)
doneWg.Done()
}()
p.model.fmut.RLock()
folderFiles := p.model.folderFiles[p.folder]