Skip to content

Commit

Permalink
add connection lost
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed Dec 17, 2023
1 parent 1c3bece commit 34a6f9d
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions ytdlbot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,10 @@ def next_salt_detector(self):
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


Expand Down

0 comments on commit 34a6f9d

Please sign in to comment.