mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
march: fix --no-traverse being very slow - fixes #8860
Before this change --no-traverse was calling NewObject on directories
(where it would always fail) as well as files. This was very
noticeable when doing syncs with --max-age which were only
transferring a small number of objects. This should have been very
quick, but the NewObject calls for each directory slowed the sync down
a lot.
This changes replaces the check to see if the source entry is an
Object that got missed out from this commit:
88e30eecbf march: fix deadlock when using --no-traverse - fixes #8656
This commit is contained in:
@@ -455,6 +455,11 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
|||||||
go func() {
|
go func() {
|
||||||
defer workerWg.Done()
|
defer workerWg.Done()
|
||||||
for t := range matchTasks {
|
for t := range matchTasks {
|
||||||
|
// Can't match directories with NewObject
|
||||||
|
if _, ok := t.src.(fs.Object); !ok {
|
||||||
|
t.dstMatch <- nil
|
||||||
|
continue
|
||||||
|
}
|
||||||
leaf := path.Base(t.src.Remote())
|
leaf := path.Base(t.src.Remote())
|
||||||
dst, err := m.Fdst.NewObject(m.Ctx, path.Join(job.dstRemote, leaf))
|
dst, err := m.Fdst.NewObject(m.Ctx, path.Join(job.dstRemote, leaf))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user