From 1073dc35b14cce9cdc3a776e55e85a027fdbb570 Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Thu, 29 Feb 2024 16:52:14 +0100 Subject: [PATCH] move watcher init to micro --- server/src/immich/app.service.ts | 6 ------ server/src/microservices/app.service.ts | 3 +++ server/src/test-utils/utils.ts | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/server/src/immich/app.service.ts b/server/src/immich/app.service.ts index be82ae4dc8..9f2553ccf6 100644 --- a/server/src/immich/app.service.ts +++ b/server/src/immich/app.service.ts @@ -45,7 +45,6 @@ export class AppService { private authService: AuthService, private configService: SystemConfigService, private jobService: JobService, - private libraryService: LibraryService, private serverService: ServerInfoService, private sharedLinkService: SharedLinkService, private storageService: StorageService, @@ -66,15 +65,10 @@ export class AppService { await this.databaseService.init(); await this.configService.init(); this.storageService.init(); - await this.libraryService.init(); await this.serverService.init(); this.logger.log(`Feature Flags: ${JSON.stringify(await this.serverService.getFeatures(), null, 2)}`); } - async teardown() { - await this.libraryService.unwatchAll(); - } - ssr(excludePaths: string[]) { let index = ''; try { diff --git a/server/src/microservices/app.service.ts b/server/src/microservices/app.service.ts index df1d9938b5..9262fe3e6c 100644 --- a/server/src/microservices/app.service.ts +++ b/server/src/microservices/app.service.ts @@ -40,6 +40,7 @@ export class AppService { async init() { await this.databaseService.init(); await this.configService.init(); + await this.libraryService.init(); await this.jobService.init({ [JobName.ASSET_DELETION]: (data) => this.assetService.handleAssetDeletion(data), [JobName.ASSET_DELETION_CHECK]: () => this.assetService.handleAssetDeletionCheck(), @@ -86,6 +87,8 @@ export class AppService { } async teardown() { + await this.libraryService.unwatchAll(); + await this.metadataService.teardown(); } } diff --git a/server/src/test-utils/utils.ts b/server/src/test-utils/utils.ts index 077239d8a3..92abe01797 100644 --- a/server/src/test-utils/utils.ts +++ b/server/src/test-utils/utils.ts @@ -131,7 +131,6 @@ export const testApp = { teardown: async () => { if (app) { await app.get(MicroAppService).teardown(); - await app.get(AppService).teardown(); await app.close(); } await db.disconnect();