Open
Description
Hi! I have a problem, Sometimes I get errors like this, although usually this code works without problems:
await db.execute("UPDATE inventory SET a = a - 1 WHERE id = %s AND peerid = %s", (id, peerid))
RuntimeError: coroutine ignored GeneratorExit
in db.execute I have this code:
async with self.connection.acquire() as con:
con: aiomysql.Connection
async with con.cursor(aiomysql.cursors.DictCursor) as cursor:
cursor: aiomysql.Cursor
result = await cursor.execute(query, args)
result = await con.commit()
return result
for self.connection I use pool with this code:
self.connection = await aiomysql.create_pool(host=host,
user=base_user,
password=base_pass,
db=base,
charset=base_charset,
autocommit=True,
pool_recycle=31536000,
)
Can you help me find mistake?
Activity