Skip to content

Commit

Permalink
only run rmdirSync 'retries' times when it throws
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 24, 2017
1 parent 5b661e4 commit e8cd685
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rimraf.js
Expand Up @@ -350,10 +350,13 @@ function rmkidsSync (p, options) {
var retries = isWindows ? 100 : 1
var i = 0
do {
var threw = true
try {
return options.rmdirSync(p, options)
var ret = options.rmdirSync(p, options)
threw = false
return ret
} finally {
if (++i < retries)
if (++i < retries && threw)
continue
}
} while (true)
Expand Down

0 comments on commit e8cd685

Please sign in to comment.