Skip to content

Commit e81a8d9

Browse files
committed
Veeam: Use restore timeout as a time interval as opposed to a counter
1 parent cd12fa5 commit e81a8d9

File tree

1 file changed

+3
-1
lines changed
  • plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam

1 file changed

+3
-1
lines changed

plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,9 @@ private boolean checkTaskStatus(final HttpResponse response) throws IOException
366366
* that is used to wait for the restore to complete before throwing a {@link CloudRuntimeException}.
367367
*/
368368
protected void checkIfRestoreSessionFinished(String type, String path) throws IOException {
369-
for (int j = 0; j < restoreTimeout; j++) {
369+
long startTime = System.currentTimeMillis();
370+
long timeoutMs = restoreTimeout * 1000L;
371+
if (System.currentTimeMillis() - startTime < timeoutMs) {
370372
HttpResponse relatedResponse = get(path);
371373
RestoreSession session = parseRestoreSessionResponse(relatedResponse);
372374
if (session.getResult().equals("Success")) {

0 commit comments

Comments
 (0)