mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(db): fix bug with releasing without lock in db.clean()
This commit is contained in:
parent
7d4a78e470
commit
10cf10c16c
@ -31,6 +31,7 @@ class SqliteDatabase:
|
||||
self.conn.execute("PRAGMA foreign_keys = ON;")
|
||||
|
||||
def clean(self) -> None:
|
||||
with self.lock:
|
||||
try:
|
||||
if self.db_path == sqlite_memory:
|
||||
return
|
||||
@ -45,5 +46,3 @@ class SqliteDatabase:
|
||||
except Exception as e:
|
||||
self._logger.error(f"Error cleaning database: {e}")
|
||||
raise
|
||||
finally:
|
||||
self.lock.release()
|
||||
|
Loading…
Reference in New Issue
Block a user