Skip to content

Commit

Permalink
fix: retry logic
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
  • Loading branch information
Dup4 committed Apr 10, 2023
1 parent fda4e1b commit f7bf0c4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions submit-stress-test/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ def submit(pid, filepath):
try:
res = requests.post(
url=url, headers=headers, data=m, timeout=10)
if res.status_code < 200:
break
except Exception as e:
logger.error(e)

if res.status_code >= 500:
continue
try:
if res.status_code != 200:
logger.error("submit faield. [filepath={}] [status_code={}]".format(
filepath, res.status_code))
else:
break

if res.status_code != 200:
logger.error("submit faield. [filepath={}] [status_code={}]".format(
filepath, res.status_code))
else:
logger.info("submit success. [filepath={}]".format(filepath))
logger.info("submit success. [filepath={}]".format(filepath))
except Exception as e:
logger.error(e)


def stress():
Expand Down

0 comments on commit f7bf0c4

Please sign in to comment.