mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
This commit is contained in:
parent
0cff66fcbc
commit
8d1eff7e41
@ -291,6 +291,8 @@ func (f *sendReceiveFolder) pullerIteration(scanChan chan<- string) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *sendReceiveFolder) processNeeded(dbUpdateChan chan<- dbUpdateJob, copyChan chan<- copyBlocksState, scanChan chan<- string) (int, map[string]protocol.FileInfo, []protocol.FileInfo, error) {
|
func (f *sendReceiveFolder) processNeeded(dbUpdateChan chan<- dbUpdateJob, copyChan chan<- copyBlocksState, scanChan chan<- string) (int, map[string]protocol.FileInfo, []protocol.FileInfo, error) {
|
||||||
|
defer f.queue.Reset()
|
||||||
|
|
||||||
changed := 0
|
changed := 0
|
||||||
var dirDeletions []protocol.FileInfo
|
var dirDeletions []protocol.FileInfo
|
||||||
fileDeletions := map[string]protocol.FileInfo{}
|
fileDeletions := map[string]protocol.FileInfo{}
|
||||||
@ -464,6 +466,7 @@ nextFile:
|
|||||||
// Remove the pending deletion (as we performed it by renaming)
|
// Remove the pending deletion (as we performed it by renaming)
|
||||||
delete(fileDeletions, candidate.Name)
|
delete(fileDeletions, candidate.Name)
|
||||||
|
|
||||||
|
changed++
|
||||||
f.queue.Done(fileName)
|
f.queue.Done(fileName)
|
||||||
continue nextFile
|
continue nextFile
|
||||||
}
|
}
|
||||||
@ -479,6 +482,7 @@ nextFile:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
f.newPullError(fileName, errNotAvailable)
|
f.newPullError(fileName, errNotAvailable)
|
||||||
|
f.queue.Done(fileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed, fileDeletions, dirDeletions, nil
|
return changed, fileDeletions, dirDeletions, nil
|
||||||
|
@ -110,6 +110,13 @@ func (q *jobQueue) Shuffle() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (q *jobQueue) Reset() {
|
||||||
|
q.mut.Lock()
|
||||||
|
defer q.mut.Unlock()
|
||||||
|
q.progress = nil
|
||||||
|
q.queued = nil
|
||||||
|
}
|
||||||
|
|
||||||
func (q *jobQueue) lenQueued() int {
|
func (q *jobQueue) lenQueued() int {
|
||||||
q.mut.Lock()
|
q.mut.Lock()
|
||||||
defer q.mut.Unlock()
|
defer q.mut.Unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user