aio-libs / aio-libs/aiomysql

coroutine ignored GeneratorExit on sql execute

Aperta
#637 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
1.9k
Fork
272
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.