Skip to content

Commit 85010c2

Browse files
author
Adelina Lintuluoto
committed
add retry config from commons
1 parent 61dbe3d commit 85010c2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

reana_client/api/client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import requests
1818
from bravado.exception import HTTPError
19-
from reana_client.config import ERROR_MESSAGES, WORKFLOW_ENGINES
19+
from reana_client.config import ERROR_MESSAGES, WORKFLOW_ENGINES, REANA_API_RETRY_NUMBER
2020
from reana_client.errors import FileDeletionError, FileUploadError
2121
from reana_client.utils import _validate_reana_yaml, is_uuid_v4
2222
from reana_commons.api_client import get_current_api_client
@@ -551,12 +551,11 @@ def upload_to_server(workflow, paths, access_token):
551551
"'{}' is an absolute filepath.".format(os.path.basename(fname))
552552
)
553553
logging.info("Uploading '{}' ...".format(fname))
554-
number_of_retries = 5
555-
for retry in range(number_of_retries + 1):
556-
if retry == number_of_retries:
554+
for retry in range(REANA_API_RETRY_NUMBER + 1):
555+
if retry == REANA_API_RETRY_NUMBER:
557556
raise Exception(
558557
"Failed to upload {}. Number of retries exceeded {}".format(
559-
path, number_of_retries
558+
path, REANA_API_RETRY_NUMBER
560559
)
561560
)
562561
try:

0 commit comments

Comments
 (0)