Skip to content

Commit

Permalink
feat: renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
tony9402 committed Jun 30, 2024
1 parent 7472854 commit 2734379
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion baekjoon_utils/baekjoon_utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from time import sleep
import random
from datetime import datetime, timezone, UTC, timedelta
from typing import Union, Tuple
Expand Down Expand Up @@ -36,7 +37,8 @@ def get_api_result(url, headers):
res = requests.get(url, headers=headers).json()
return res
except Exception as e:
if retry + 1 == retry_count:
if retry + 1 != retry_count:
sleep(2)
continue
raise Exception

Expand Down

0 comments on commit 2734379

Please sign in to comment.