Skip to content

Commit

Permalink
Do not acquire semaphore worker for directory
Browse files Browse the repository at this point in the history
  • Loading branch information
otiai10 committed Sep 7, 2023
1 parent c165d68 commit 79342f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ func dcopyConcurrent(srcdir, destdir string, contents []os.FileInfo, opt Options
case <-opt.intent.ctx.Done():
return nil
default:
if content.IsDir() {
return copyNextOrSkip(cs, cd, content, opt)
}
if err := opt.intent.sem.Acquire(cancelctx, 1); err != nil {
cancel()
return err
Expand Down

0 comments on commit 79342f5

Please sign in to comment.