Skip to content

Commit

Permalink
sync: list another prefix when finsh one (#5646)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro authored Feb 14, 2025
1 parent 330985e commit 39afff4
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions pkg/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -1373,23 +1373,16 @@ func startProducer(tasks chan<- object.Object, src, dst object.ObjectStorage, pr
logger.Infof("ignore prefix %s", c.Key())
continue
}
select {
case config.concurrentList <- 1:
wg.Add(1)
go func(prefix string) {
defer wg.Done()
err := startProducer(tasks, src, dst, prefix, listDepth-1, config)
if err != nil {
logger.Fatalf("list prefix %s: %s", prefix, err)
}
<-config.concurrentList
}(c.Key())
default:
err := startProducer(tasks, src, dst, c.Key(), listDepth-1, config)
wg.Add(1)
go func(prefix string) {
defer wg.Done()
err := startProducer(tasks, src, dst, prefix, listDepth-1, config)
if err != nil {
logger.Fatalf("list prefix %s: %s", c.Key(), err)
logger.Fatalf("list prefix %s: %s", prefix, err)
}
}
<-config.concurrentList
}(c.Key())
config.concurrentList <- 1
}
}()

Expand Down

0 comments on commit 39afff4

Please sign in to comment.