mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2024-09-20 15:05:56 +08:00
add connection lost
This commit is contained in:
parent
1c3becee9d
commit
34a6f9d870
|
@ -182,20 +182,10 @@ class Detector:
|
||||||
logging.critical("Next salt crash: %s", self.func_name())
|
logging.critical("Next salt crash: %s", self.func_name())
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def msg_id_detector(self):
|
def connection_reset_detector(self):
|
||||||
text = "The msg_id is too low"
|
text = "Send exception: ConnectionResetError Connection lost"
|
||||||
if text in self.logs:
|
if text in self.logs:
|
||||||
logging.critical("msg id crash: %s ", self.func_name())
|
logging.critical("connection lost: %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())
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue