From fdae3b970eaf2b9fcdb8c25863cbc42bbf5c4785 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Tue, 3 May 2022 21:50:50 +0300 Subject: [PATCH] Add retries_list.txt system --- HookSystem.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HookSystem.py b/HookSystem.py index bc72c51..5323bd9 100644 --- a/HookSystem.py +++ b/HookSystem.py @@ -22,7 +22,7 @@ def check_int(func: callable) -> callable: def _last_records(operation_id: int, limit: int) -> list[dict]: last_exception: Exception | None = None - for retry in range(0, 3): + for retry in range(0, 10): try: return Hook.get_db().execute( HookUtils.SQL_REQUESTS.GET_HISTORICAL_INFO, @@ -41,6 +41,9 @@ def _last_records(operation_id: int, limit: int) -> list[dict]: last_exception = e continue + with open('retries_list.txt', mode='a') as retries_file: + retries_file.write(f'{operation_id}\n') + raise last_exception