1
mirror of https://github.com/rclone/rclone synced 2024-11-17 17:30:37 +01:00

acd: Fix deadlock in directory traversal code

This commit is contained in:
Nick Craig-Wood 2016-01-24 11:20:55 +00:00
parent c3a0c0c451
commit c47b4f828f

View File

@ -420,11 +420,14 @@ func (f *Fs) listDirNonRecursive(dirID string, path string, out fs.ObjectsChan)
errs <- err errs <- err
} }
// FIXME stop traversal on error? // FIXME stop traversal on error?
// Now we have traversed this directory, send these jobs off for traversal traversing.Add(len(jobs))
for _, job := range jobs { go func() {
traversing.Add(1) // Now we have traversed this directory, send these jobs off for traversal in
in <- job // the background
} for _, job := range jobs {
in <- job
}
}()
traversing.Done() traversing.Done()
} }
}() }()