Skip to content

Commit

Permalink
User self.release() method to release a connection while releasing a …
Browse files Browse the repository at this point in the history
…cursor
  • Loading branch information
rudyryk committed May 6, 2016
1 parent e4617ed commit ee93457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions peewee_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ def release_cursor(self, cursor, in_transaction=False):
conn = cursor.connection
cursor.close()
if not in_transaction:
self.pool.release(conn)
self.release(conn)


class AsyncPostgresqlMixin(AsyncDatabase):
Expand Down Expand Up @@ -1170,7 +1170,7 @@ def release_cursor(self, cursor, in_transaction=False):
conn = cursor.connection
yield from cursor.close()
if not in_transaction:
self.pool.release(conn)
self.release(conn)


class MySQLDatabase(AsyncDatabase, peewee.MySQLDatabase):
Expand Down

0 comments on commit ee93457

Please sign in to comment.