fix: DB creation v2
All checks were successful
Build Docker / Build SLDs Image (push) Successful in 16s
Build Docker / Build Main Image (push) Successful in 19s

This commit is contained in:
Nathan Woodburn 2023-11-08 19:15:23 +11:00
parent 88b1ea53f5
commit 083796b035
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 3 additions and 0 deletions

1
db.py
View File

@ -30,6 +30,7 @@ def check_tables():
""") """)
cursor.close() cursor.close()
connection.close() connection.close()
print("Checked tables")
def add_user(email,domain,password,token): def add_user(email,domain,password,token):
connection = mysql.connector.connect(**dbargs) connection = mysql.connector.connect(**dbargs)

View File

@ -7,6 +7,7 @@ import os
import dotenv import dotenv
import sys import sys
import json import json
import db
class GunicornApp(BaseApplication): class GunicornApp(BaseApplication):
@ -24,6 +25,7 @@ class GunicornApp(BaseApplication):
return self.application return self.application
if __name__ == '__main__': if __name__ == '__main__':
db.check_tables()
workers = os.getenv('WORKERS') workers = os.getenv('WORKERS')
threads = os.getenv('THREADS') threads = os.getenv('THREADS')
if workers is None: if workers is None: