Skip to content

coroutine ignored GeneratorExit on sql execute #637

Open
@suregoodru

Description

@suregoodru

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions