Skip to content

Commit

Permalink
Use RunDB.rundb_retry in XENON_CONFIG to control number of retry (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx authored Sep 22, 2024
1 parent 26ec511 commit 16be27e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utilix/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ def new_token(self):
data = json.dumps({"username": username, "password": pw})
logger.debug("Creating a new token: doing API call now")
# try making a new token 3 times
n_try = uconfig.get("RunDB", "rundb_retry", fallback=3)
success = False
for _try in range(3):
for _try in range(n_try):
try:
response = requests.post(path, data=data, headers=BASE_HEADERS)
response_json = json.loads(response.text)
Expand Down

0 comments on commit 16be27e

Please sign in to comment.