fix(api): use db_location instead of db_path_string

This may just be the SQLite memory sentinel value.
This commit is contained in:
psychedelicious 2023-08-03 10:08:44 +10:00
parent 66f524cae7
commit d09dfc3e9b

View File

@ -70,20 +70,20 @@ class ApiDependencies:
# TODO: build a file/path manager? # TODO: build a file/path manager?
db_path = config.db_path db_path = config.db_path
db_path.parent.mkdir(parents=True, exist_ok=True) db_path.parent.mkdir(parents=True, exist_ok=True)
db_path_string = str(db_path) db_location = str(db_path)
graph_execution_manager = SqliteItemStorage[GraphExecutionState]( graph_execution_manager = SqliteItemStorage[GraphExecutionState](
filename=db_path_string, table_name="graph_executions" filename=db_location, table_name="graph_executions"
) )
urls = LocalUrlService() urls = LocalUrlService()
image_record_storage = SqliteImageRecordStorage(db_path_string) image_record_storage = SqliteImageRecordStorage(db_location)
image_file_storage = DiskImageFileStorage(f"{output_folder}/images") image_file_storage = DiskImageFileStorage(f"{output_folder}/images")
names = SimpleNameService() names = SimpleNameService()
latents = ForwardCacheLatentsStorage(DiskLatentsStorage(f"{output_folder}/latents")) latents = ForwardCacheLatentsStorage(DiskLatentsStorage(f"{output_folder}/latents"))
board_record_storage = SqliteBoardRecordStorage(db_path_string) board_record_storage = SqliteBoardRecordStorage(db_location)
board_image_record_storage = SqliteBoardImageRecordStorage(db_path_string) board_image_record_storage = SqliteBoardImageRecordStorage(db_location)
boards = BoardService( boards = BoardService(
services=BoardServiceDependencies( services=BoardServiceDependencies(
@ -125,7 +125,7 @@ class ApiDependencies:
boards=boards, boards=boards,
board_images=board_images, board_images=board_images,
queue=MemoryInvocationQueue(), queue=MemoryInvocationQueue(),
graph_library=SqliteItemStorage[LibraryGraph](filename=db_path_string, table_name="graphs"), graph_library=SqliteItemStorage[LibraryGraph](filename=db_location, table_name="graphs"),
graph_execution_manager=graph_execution_manager, graph_execution_manager=graph_execution_manager,
processor=DefaultInvocationProcessor(), processor=DefaultInvocationProcessor(),
configuration=config, configuration=config,