Skip to content

Commit cf2bce6

Browse files
authored
fs: fix regression on rmsync
PR-URL: nodejs#53982 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent db594d0 commit cf2bce6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/node_file.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,8 @@ static void RmSync(const FunctionCallbackInfo<Value>& args) {
16541654
error == std::errc::operation_not_permitted);
16551655
};
16561656

1657+
int i = 1;
1658+
16571659
while (maxRetries >= 0) {
16581660
if (recursive) {
16591661
std::filesystem::remove_all(file_path, error);
@@ -1667,14 +1669,15 @@ static void RmSync(const FunctionCallbackInfo<Value>& args) {
16671669
break;
16681670
}
16691671

1670-
if (retryDelay != 0) {
1672+
if (retryDelay > 0) {
16711673
#ifdef _WIN32
1672-
Sleep(retryDelay / 1000);
1674+
Sleep(i * retryDelay / 1000);
16731675
#else
1674-
sleep(retryDelay / 1000);
1676+
sleep(i * retryDelay / 1000);
16751677
#endif
16761678
}
16771679
maxRetries--;
1680+
i++;
16781681
}
16791682

16801683
// On Windows path::c_str() returns wide char, convert to std::string first.

0 commit comments

Comments
 (0)