mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2024-11-10 09:12:45 +08:00
add connection lost
This commit is contained in:
parent
1c3becee9d
commit
34a6f9d870
1 changed files with 3 additions and 13 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue