diff --git a/invokeai/app/api/dependencies.py b/invokeai/app/api/dependencies.py index 38ded5c705..83fc8d9e11 100644 --- a/invokeai/app/api/dependencies.py +++ b/invokeai/app/api/dependencies.py @@ -2,7 +2,6 @@ from typing import Optional from logging import Logger -import threading import os from invokeai.app.services.board_image_record_storage import ( SqliteBoardImageRecordStorage, @@ -66,8 +65,6 @@ class ApiDependencies: logger.info(f"Root directory = {str(config.root_path)}") logger.debug(f"Internet connectivity is {config.internet_available}") - lock = threading.Lock() - events = FastAPIEventService(event_handler_id) output_folder = config.output_path diff --git a/invokeai/app/services/sqlite.py b/invokeai/app/services/sqlite.py index ea869ceace..1b70a98929 100644 --- a/invokeai/app/services/sqlite.py +++ b/invokeai/app/services/sqlite.py @@ -21,6 +21,7 @@ class SqliteItemStorage(ItemStorageABC, Generic[T]): def __init__(self, filename: str, table_name: str, id_field: str = "id"): super().__init__() + self._filename = filename self._table_name = table_name self._id_field = id_field # TODO: validate that T has this field @@ -54,7 +55,6 @@ class SqliteItemStorage(ItemStorageABC, Generic[T]): def set(self, item: T): try: self._lock.acquire() - self._cursor.execute( f"""INSERT OR REPLACE INTO {self._table_name} (item) VALUES (?);""", (item.json(),),