Commit aefad2d
committed
fix(fs): implement retry logic for safeDelete and safeDeleteSync
The maxRetries and retryDelay options in RemoveOptions were documented
but not actually implemented. Previously, maxRetries was incorrectly
passed as the 'concurrency' option to del, which controls parallelism
not retries.
Changes:
- safeDelete now wraps deleteAsync with pRetry for exponential backoff
- safeDeleteSync implements sync retry loop with Atomics.wait for sleep
- Both use backoffFactor: 2 (delay doubles each retry)
- Added tests for retry options1 parent 807857f commit aefad2d
2 files changed
Lines changed: 78 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
1270 | 1271 | | |
1271 | 1272 | | |
1272 | 1273 | | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1273 | 1277 | | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1280 | 1293 | | |
1281 | 1294 | | |
1282 | 1295 | | |
| |||
1351 | 1364 | | |
1352 | 1365 | | |
1353 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
1354 | 1370 | | |
1355 | | - | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
1360 | | - | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1361 | 1395 | | |
1362 | 1396 | | |
1363 | 1397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
819 | 835 | | |
820 | 836 | | |
821 | 837 | | |
| |||
875 | 891 | | |
876 | 892 | | |
877 | 893 | | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
878 | 910 | | |
879 | 911 | | |
880 | 912 | | |
| |||
0 commit comments