GeezerVison is showing github.com — fs: rename rimraf's maxBusyTries to maxRetries · nodejs/node@dfb86f9
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: doc/api/fs.md +11-2Lines changed: 11 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3220,6 +3220,9 @@ Synchronous rename(2). Returns `undefined`. | 3220 | 3220 | <!-- YAML | 3221 | 3221 | added: v0.0.2 | 3222 | 3222 | changes: | | 3223 | + - version: REPLACEME | | 3224 | + pr-url: https://github.com/nodejs/node/pull/30644 | | 3225 | + description: The `maxBusyTries` option is renamed to `maxRetries`. | 3223 | 3226 | - version: v12.10.0 | 3224 | 3227 | pr-url: https://github.com/nodejs/node/pull/29168 | 3225 | 3228 | description: The `recursive`, `maxBusyTries`, and `emfileWait` options are | @@ -3246,7 +3249,7 @@ changes: | 3246 | 3249 | retry the operation with a linear backoff of 1ms longer on each try until the | 3247 | 3250 | timeout duration passes this limit. This option is ignored if the `recursive` | 3248 | 3251 | option is not `true`. **Default:** `1000`. | 3249 | | - * `maxBusyTries` {integer} If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error is | | 3252 | + * `maxRetries` {integer} If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error is | 3250 | 3253 | encountered, Node.js will retry the operation with a linear backoff wait of | 3251 | 3254 | 100ms longer on each try. This option represents the number of retries. This | 3252 | 3255 | option is ignored if the `recursive` option is not `true`. **Default:** `3`. | @@ -3266,6 +3269,9 @@ Windows and an `ENOTDIR` error on POSIX. | 3266 | 3269 | <!-- YAML | 3267 | 3270 | added: v0.1.21 | 3268 | 3271 | changes: | | 3272 | + - version: REPLACEME | | 3273 | + pr-url: https://github.com/nodejs/node/pull/30644 | | 3274 | + description: The `maxBusyTries` option is renamed to `maxRetries`. | 3269 | 3275 | - version: v12.10.0 | 3270 | 3276 | pr-url: https://github.com/nodejs/node/pull/29168 | 3271 | 3277 | description: The `recursive`, `maxBusyTries`, and `emfileWait` options are | @@ -4990,6 +4996,9 @@ upon success. | 4990 | 4996 | <!-- YAML | 4991 | 4997 | added: v10.0.0 | 4992 | 4998 | changes: | | 4999 | + - version: REPLACEME | | 5000 | + pr-url: https://github.com/nodejs/node/pull/30644 | | 5001 | + description: The `maxBusyTries` option is renamed to `maxRetries`. | 4993 | 5002 | - version: v12.10.0 | 4994 | 5003 | pr-url: https://github.com/nodejs/node/pull/29168 | 4995 | 5004 | description: The `recursive`, `maxBusyTries`, and `emfileWait` options are | @@ -5004,7 +5013,7 @@ changes: | 5004 | 5013 | retry the operation with a linear backoff of 1ms longer on each try until the | 5005 | 5014 | timeout duration passes this limit. This option is ignored if the `recursive` | 5006 | 5015 | option is not `true`. **Default:** `1000`. | 5007 | | - * `maxBusyTries` {integer} If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error is | | 5016 | + * `maxRetries` {integer} If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error is | 5008 | 5017 | encountered, Node.js will retry the operation with a linear backoff wait of | 5009 | 5018 | 100ms longer on each try. This option represents the number of retries. This | 5010 | 5019 | option is ignored if the `recursive` option is not `true`. **Default:** `3`. | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/fs/rimraf.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,7 +35,7 @@ function rimraf(path, options, callback) { | 35 | 35 | _rimraf(path, options, function CB(err) { | 36 | 36 | if (err) { | 37 | 37 | if ((err.code === 'EBUSY' || err.code === 'ENOTEMPTY' || | 38 | | - err.code === 'EPERM') && busyTries < options.maxBusyTries) { | | 38 | + err.code === 'EPERM') && busyTries < options.maxRetries) { | 39 | 39 | busyTries++; | 40 | 40 | return setTimeout(_rimraf, busyTries * 100, path, options, CB); | 41 | 41 | } | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/fs/utils.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -564,7 +564,7 @@ function warnOnNonPortableTemplate(template) { | 564 | 564 |
| 565 | 565 | const defaultRmdirOptions = { | 566 | 566 | emfileWait: 1000, | 567 | | - maxBusyTries: 3, | | 567 | + maxRetries: 3, | 568 | 568 | recursive: false, | 569 | 569 | }; | 570 | 570 |
| @@ -580,7 +580,7 @@ const validateRmdirOptions = hideStackFrames((options) => { | 580 | 580 | throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', options.recursive); | 581 | 581 |
| 582 | 582 | validateInt32(options.emfileWait, 'emfileWait', 0); | 583 | | - validateUint32(options.maxBusyTries, 'maxBusyTries'); | | 583 | + validateUint32(options.maxRetries, 'maxRetries'); | 584 | 584 |
| 585 | 585 | return options; | 586 | 586 | }); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-fs-rmdir-recursive.js +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -156,23 +156,23 @@ function removeAsync(dir) { | 156 | 156 | { | 157 | 157 | const defaults = { | 158 | 158 | emfileWait: 1000, | 159 | | - maxBusyTries: 3, | | 159 | + maxRetries: 3, | 160 | 160 | recursive: false | 161 | 161 | }; | 162 | 162 | const modified = { | 163 | 163 | emfileWait: 953, | 164 | | - maxBusyTries: 5, | | 164 | + maxRetries: 5, | 165 | 165 | recursive: true | 166 | 166 | }; | 167 | 167 |
| 168 | 168 | assert.deepStrictEqual(validateRmdirOptions(), defaults); | 169 | 169 | assert.deepStrictEqual(validateRmdirOptions({}), defaults); | 170 | 170 | assert.deepStrictEqual(validateRmdirOptions(modified), modified); | 171 | 171 | assert.deepStrictEqual(validateRmdirOptions({ | 172 | | - maxBusyTries: 99 | | 172 | + maxRetries: 99 | 173 | 173 | }), { | 174 | 174 | emfileWait: 1000, | 175 | | - maxBusyTries: 99, | | 175 | + maxRetries: 99, | 176 | 176 | recursive: false | 177 | 177 | }); | 178 | 178 |
| @@ -205,10 +205,10 @@ function removeAsync(dir) { | 205 | 205 | }); | 206 | 206 |
| 207 | 207 | common.expectsError(() => { | 208 | | - validateRmdirOptions({ maxBusyTries: -1 }); | | 208 | + validateRmdirOptions({ maxRetries: -1 }); | 209 | 209 | }, { | 210 | 210 | code: 'ERR_OUT_OF_RANGE', | 211 | 211 | type: RangeError, | 212 | | - message: /^The value of "maxBusyTries" is out of range\./ | | 212 | + message: /^The value of "maxRetries" is out of range\./ | 213 | 213 | }); | 214 | 214 | } |
|