Skip to content

Commit

Permalink
read results after lock release (#29)
Browse files Browse the repository at this point in the history
The `SELECT RELEASE_LOCK` seems to return results that are not read which trigger the "unread result" error when using functions legitimately.
  • Loading branch information
inetAnt authored and dclaisse committed Apr 24, 2019
1 parent 0f67a92 commit 1c60b38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ipam/client/backends/phpipam.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def __exit__(self, exception_type, exception_value, exception_traceback):
self.ipam.db.commit()
self.ipam.cur.execute('SELECT RELEASE_LOCK("{}")'.format(
LOCK_NAME))
# empty cursor to avoid "unread results" error
self.ipam.cur.fetchall()
self.ipam.db.autocommit = True


Expand Down

0 comments on commit 1c60b38

Please sign in to comment.