Commit b2c21925 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

update retry

parent b80a0ddd
Pipeline #11678 passed with stage
...@@ -17,6 +17,7 @@ def retry(func, *args, **kwargs): ...@@ -17,6 +17,7 @@ def retry(func, *args, **kwargs):
else: else:
n_try = 5 n_try = 5
# is DFS? # is DFS?
# TODO: support DFS2
is_dfs = func.__class__.__module__.startswith("csst_dfs_client") is_dfs = func.__class__.__module__.startswith("csst_dfs_client")
# start trials # start trials
for attempt in range(n_try): for attempt in range(n_try):
...@@ -24,7 +25,8 @@ def retry(func, *args, **kwargs): ...@@ -24,7 +25,8 @@ def retry(func, *args, **kwargs):
try: try:
res = func(*args, **kwargs) res = func(*args, **kwargs)
if is_dfs: if is_dfs:
assert res["code"] == 0, res # TODO: support DFS2
assert res.success, res
return res return res
except Exception as e: except Exception as e:
# print error messages # print error messages
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment