Veeam: Use restore timeout as a time interval as opposed to a counter

This commit is contained in:
Pearl Dsilva 2025-10-01 09:31:27 -04:00
parent cd12fa5848
commit e81a8d915e

View File

@ -366,7 +366,9 @@ public class VeeamClient {
* that is used to wait for the restore to complete before throwing a {@link CloudRuntimeException}.
*/
protected void checkIfRestoreSessionFinished(String type, String path) throws IOException {
for (int j = 0; j < restoreTimeout; j++) {
long startTime = System.currentTimeMillis();
long timeoutMs = restoreTimeout * 1000L;
if (System.currentTimeMillis() - startTime < timeoutMs) {
HttpResponse relatedResponse = get(path);
RestoreSession session = parseRestoreSessionResponse(relatedResponse);
if (session.getResult().equals("Success")) {