1
0
mirror of https://github.com/norohind/jubilant-system-core.git synced 2025-04-17 03:32:19 +03:00

HookSystem._last_records don't print exception on first try

This commit is contained in:
norohind 2022-04-21 23:43:23 +03:00
parent 5027ef748c
commit fea8380529
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

@ -1,5 +1,7 @@
import os
import functools
import sqlite3
from Hook import Hook
import importlib.machinery
import HookUtils
@ -27,6 +29,13 @@ def _last_records(operation_id: int, limit: int) -> list[dict]:
{'limit': limit, 'operation_id': operation_id}
).fetchall()
except sqlite3.DatabaseError as e:
if retry != 0:
logger.opt(exception=True).warning(f'Exception in {threading.current_thread().name}, retry: {retry}')
last_exception = e
continue
except Exception as e:
logger.opt(exception=True).warning(f'Exception in {threading.current_thread().name}, retry: {retry}')
last_exception = e