Skip to content
Browse files

Simplify the EBUSY backoff logic.

  • Loading branch information...
1 parent 1c39661 commit 0b21fbe0ba64682621e852f10bb0a39a125dc0d1 @isaacs committed Jun 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 rimraf.js
View
4 rimraf.js
@@ -36,12 +36,12 @@ function rimraf (p, cb) {
rimraf_(p, function CB (er) {
if (er) {
if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) {
- var time = (exports.BUSYTRIES_MAX - busyTries) * 100
busyTries ++
+ var time = busyTries * 100
// try again, with the same exact callback as this one.
return setTimeout(function () {
rimraf_(p, CB)
- })
+ }, time)
}
// this one won't happen if graceful-fs is used.

0 comments on commit 0b21fbe

Please sign in to comment.
Something went wrong with that request. Please try again.