Skip to content

Commit

Permalink
Update backend.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdu committed Nov 20, 2024
1 parent 23f8fd0 commit aa6dd0c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ def __del__(self):

@property
def cursor(self):
self._lock.acquire()
cur = self.conn.cursor()
self._lock.release()
with self._lock:
cur = self.conn.cursor()

return cur

def _optimize(self):
self.query("PRAGMA synchronous=OFF")
Expand Down

0 comments on commit aa6dd0c

Please sign in to comment.