just reconnect regardless of whatever before an execution

This commit is contained in:
Philipp 2022-10-07 20:03:11 +02:00
parent 4fc4b6a018
commit b2c9c95821
Signed by: Philipp
GPG key ID: 9EBD8439AFBAB750

View file

@ -12,6 +12,7 @@ class Database:
) )
def init_test_database(self): def init_test_database(self):
self.con.reconnect()
cursor = self.con.cursor() cursor = self.con.cursor()
try: try:
cursor.execute("CREATE TABLE discord_link ( admin_id int(10) UNSIGNED NOT NULL, discord_id bigint(20) UNSIGNED NOT NULL, steamid varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL);") cursor.execute("CREATE TABLE discord_link ( admin_id int(10) UNSIGNED NOT NULL, discord_id bigint(20) UNSIGNED NOT NULL, steamid varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL);")
@ -29,6 +30,7 @@ class Database:
raise Exception("Error while trying to connect to database.") raise Exception("Error while trying to connect to database.")
def create_reserved_slot(self, discord_user, steam_id): def create_reserved_slot(self, discord_user, steam_id):
self.con.reconnect()
cursor = self.con.cursor() cursor = self.con.cursor()
try: try: