Skip to content

Commit

Permalink
Improve windows retry loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jfantinhardesty committed Jul 2, 2024
1 parent 5b8d436 commit caead9e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,15 @@ Result<const ISettingsResponse *> Engine::settingsReceived()
return error(ErrorCode::internalError, "Unable to launch mount with error: " + mountRet.output);
}

// On Windows, mount does not show up immediately, so need to wait
#ifdef _WIN32
Sleep(5000);
#endif
// Mount might not show up immediately, so wait for mount to appear
int retryCount = 0;
while (!cfManager.isMounted() && retryCount < 10)
{
Sleep(1000);
retryCount++;
}

if (!cfManager.isMounted())
if (retryCount == 10)
{
return error(ErrorCode::internalError, "Cloudfuse was not able to successfully mount");
}
Expand Down

0 comments on commit caead9e

Please sign in to comment.