Skip to content

Commit

Permalink
Timescale listener: recreate dbconn if it is closed, should help if f…
Browse files Browse the repository at this point in the history
…or some reason the connection is closed (for some reason) before logging end time.
  • Loading branch information
cyberw committed Apr 22, 2022
1 parent 07a9367 commit 2bddc07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions locust_plugins/listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def __init__(
def dbcursor(self):
with self.dblock:
try:
if self.dbconn.closed:
self.dbconn = self._dbconn()
yield self.dbconn.cursor()
except psycopg2.Error:
try:
Expand Down

0 comments on commit 2bddc07

Please sign in to comment.