Skip to content

Commit

Permalink
Update database.py - pymysql.err.InterfaceError: (0,”) error (#325)
Browse files Browse the repository at this point in the history
check if the connection exists, and reconnect if disconnected.
  • Loading branch information
vuisme committed Dec 24, 2023
1 parent 682d7db commit b3cabe3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ytdlbot/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def __init__(self):
self.con = pymysql.connect(
host=MYSQL_HOST, user=MYSQL_USER, passwd=MYSQL_PASS, db="ytdl", charset="utf8mb4"
)
self.con.ping(reconnect = True)
except Exception:
logging.warning("MySQL connection failed, using fake mysql instead.")
self.con = FakeMySQL()
Expand Down

0 comments on commit b3cabe3

Please sign in to comment.