From 2734379a3b6f9c93b30a05ca8ccf789f792fdb39 Mon Sep 17 00:00:00 2001 From: tony9402 Date: Mon, 1 Jul 2024 01:47:27 +0900 Subject: [PATCH] feat: renewal --- baekjoon_utils/baekjoon_utils/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/baekjoon_utils/baekjoon_utils/utils.py b/baekjoon_utils/baekjoon_utils/utils.py index 5ca2188425b..0ae3f5c0adb 100644 --- a/baekjoon_utils/baekjoon_utils/utils.py +++ b/baekjoon_utils/baekjoon_utils/utils.py @@ -1,3 +1,4 @@ +from time import sleep import random from datetime import datetime, timezone, UTC, timedelta from typing import Union, Tuple @@ -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