From e47e25e671b1c53c33d71659debfe1def86c6839 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 21 Dec 2023 12:52:49 -0600 Subject: [PATCH] fix(server): access system config before database migration complete (#5912) --- docker/docker-compose.dev.yml | 1 + server/src/domain/domain.module.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index ef8feb83f6..a45c7490af 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -12,6 +12,7 @@ x-server-build: &server-common context: ../ dockerfile: server/Dockerfile target: dev + restart: always volumes: - ../server:/usr/src/app - ${UPLOAD_LOCATION}/photos:/usr/src/app/upload diff --git a/server/src/domain/domain.module.ts b/server/src/domain/domain.module.ts index 4cd4b77dbf..ff666d89a2 100644 --- a/server/src/domain/domain.module.ts +++ b/server/src/domain/domain.module.ts @@ -49,8 +49,9 @@ const providers: Provider[] = [ ImmichLogger, { provide: INITIAL_SYSTEM_CONFIG, - inject: [SystemConfigService], - useFactory: async (configService: SystemConfigService) => { + inject: [SystemConfigService, DatabaseService], + useFactory: async (configService: SystemConfigService, databaseService: DatabaseService) => { + await databaseService.init(); return configService.getConfig(); }, },