(path, options, callback)
| 35 | |
| 36 | |
| 37 | function rimraf(path, options, callback) { |
| 38 | let retries = 0; |
| 39 | |
| 40 | _rimraf(path, options, function CB(err) { |
| 41 | if (err) { |
| 42 | if (retryErrorCodes.has(err.code) && retries < options.maxRetries) { |
| 43 | retries++; |
| 44 | const delay = retries * options.retryDelay; |
| 45 | return setTimeout(_rimraf, delay, path, options, CB); |
| 46 | } |
| 47 | |
| 48 | // The file is already gone. |
| 49 | if (err.code === 'ENOENT') |
| 50 | err = null; |
| 51 | } |
| 52 | |
| 53 | callback(err); |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | function _rimraf(path, options, callback) { |
no test coverage detected