Implemented alembic migrations, added cursors closing task.

This commit is contained in:
2025-02-25 23:37:55 +03:00
parent 836ce1dc82
commit 1abc225923
17 changed files with 746 additions and 101 deletions

View File

@@ -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():