fix: use buffer so that we can use fetchone when multi line

This commit is contained in:
Ting-Jun Wang 2024-08-23 20:55:13 +08:00
parent 2e3ce28468
commit 7749a2735a
Signed by: snsd0805
GPG Key ID: 48D331A3D6160354

View File

@ -18,13 +18,13 @@ class CMLAccountManager():
def find_user(self, username):
try:
cursor = self.conn.cursor()
cursor = self.conn.cursor(buffered=True)
except:
if self.conn.is_connected():
self.conn.close()
print("Restart DB Connection")
self.conn = mysql.connector.connect(**self.config)
cursor = self.conn.cursor()
cursor = self.conn.cursor(buffered=True)
query = "SELECT * FROM `People` WHERE `account`=%s"
param = (username, )