Implemented alembic migrations, added cursors closing task.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
from data.schemas import SelectQueryBase
|
||||
|
||||
def build_sql_query_text(query: SelectQueryBase) -> tuple[str, list]:
|
||||
@@ -20,6 +20,12 @@ async def pools_creator():
|
||||
mysql.pools[connection.id] = await mysql.pool_creator(connection=connection)
|
||||
logging.info(msg='Created Pools')
|
||||
|
||||
async def cursors_closer():
|
||||
from dbs import mysql
|
||||
for cursor_id, cursor in mysql.cached_cursors.items():
|
||||
await cursor.close()
|
||||
logging.info(f'Closed cursor: {cursor_id}')
|
||||
|
||||
async def pools_destroy():
|
||||
from dbs import mysql
|
||||
for connection_id, pool in mysql.pools.items():
|
||||
|
||||
Reference in New Issue
Block a user