diff --git a/HookSystem.py b/HookSystem.py index 867eca7..bc72c51 100644 --- a/HookSystem.py +++ b/HookSystem.py @@ -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