Skip to content

Commit

Permalink
add sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
chengshifan committed Feb 21, 2024
1 parent b5aa15b commit 3ccaf7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/handlers/job_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def get_token_by_app_role(app_role_url, role_id, secret_id):
json_res = json.loads(res.content)
token = json_res['auth']['client_token']
return token
time.sleep(5)
err_msg = "Getting token from Vault error even tried 10 times, url is {}, API response is {}:{}".format(app_role_url, res.status_code, res.text)
abort(400, err_msg)

Expand All @@ -67,6 +68,7 @@ def get_value_from_vault(url, token, secret_key, verify):
else:
value = json_res['data'].get(secret_key)
return value
time.sleep(5)
err_msg = "Getting value from Vault error even tried 10 times, url is {}, API response is {}:{}".format(url, response.status_code, response.text)
abort(400, err_msg)

Expand Down

0 comments on commit 3ccaf7a

Please sign in to comment.