Skip to content

Commit

Permalink
Explicitly close database connection at worker termination
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Nov 15, 2023
1 parent 5b6eff5 commit d53be38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/lib/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def run(self):
location = "->".join(frames)
self.log.error("Worker %s raised exception %s and will abort: %s at %s" % (self.type, e.__class__.__name__, str(e), location))
self.job.add_status("Crash during execution")
finally:
self.db.close()

def abort(self):
"""
Expand Down

0 comments on commit d53be38

Please sign in to comment.