From 34a6f9d8703d18012072088d0f23307857feaf40 Mon Sep 17 00:00:00 2001 From: Benny Date: Sun, 17 Dec 2023 17:24:26 +0100 Subject: [PATCH] add connection lost --- ytdlbot/utils.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/ytdlbot/utils.py b/ytdlbot/utils.py index 9d5e046..54ca418 100644 --- a/ytdlbot/utils.py +++ b/ytdlbot/utils.py @@ -182,20 +182,10 @@ class Detector: logging.critical("Next salt crash: %s", self.func_name()) return True - def msg_id_detector(self): - text = "The msg_id is too low" + def connection_reset_detector(self): + text = "Send exception: ConnectionResetError Connection lost" if text in self.logs: - logging.critical("msg id crash: %s ", self.func_name()) - for item in pathlib.Path(__file__).parent.glob("*.session"): - logging.warning("Removing session file: %s", item) - item.unlink(missing_ok=True) - time.sleep(3) - return True - - def sqlite_locked_detector(self): - text = "sqlite3.OperationalError: database is locked" - if text in self.logs: - logging.critical("database is locked: %s ", self.func_name()) + logging.critical("connection lost: %s ", self.func_name()) return True