Making it just one connection

Changing name of the previous name so I know the difference between Asynchronous and Blocking connections
pull/8/head
sgoudham 4 years ago
parent 529494bc54
commit 3dc8744024

@ -11,7 +11,7 @@ host = config('DB_HOST')
# Setting up connection using pool/aiomysql # Setting up connection using pool/aiomysql
async def connection2(loop): async def connection(loop):
pool = await aiomysql.create_pool( pool = await aiomysql.create_pool(
host=host, host=host,
port=3306, port=3306,
@ -24,11 +24,11 @@ async def connection2(loop):
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
loop.run_until_complete(connection2(loop)) loop.run_until_complete(connection(loop))
# Connect to MariaDB Platform and database Enso # Defining connection for when the bot isn't ready yet
def connection(): def startup_connection():
try: try:
conn = mariadb.connect( conn = mariadb.connect(
user="hamothy", user="hamothy",

Loading…
Cancel
Save