move watcher init to micro

This commit is contained in:
Jonathan Jogenfors
2024-02-29 16:52:14 +01:00
parent f1331905f0
commit 1073dc35b1
3 changed files with 3 additions and 7 deletions
-6
View File
@@ -45,7 +45,6 @@ export class AppService {
private authService: AuthService, private authService: AuthService,
private configService: SystemConfigService, private configService: SystemConfigService,
private jobService: JobService, private jobService: JobService,
private libraryService: LibraryService,
private serverService: ServerInfoService, private serverService: ServerInfoService,
private sharedLinkService: SharedLinkService, private sharedLinkService: SharedLinkService,
private storageService: StorageService, private storageService: StorageService,
@@ -66,15 +65,10 @@ export class AppService {
await this.databaseService.init(); await this.databaseService.init();
await this.configService.init(); await this.configService.init();
this.storageService.init(); this.storageService.init();
await this.libraryService.init();
await this.serverService.init(); await this.serverService.init();
this.logger.log(`Feature Flags: ${JSON.stringify(await this.serverService.getFeatures(), null, 2)}`); this.logger.log(`Feature Flags: ${JSON.stringify(await this.serverService.getFeatures(), null, 2)}`);
} }
async teardown() {
await this.libraryService.unwatchAll();
}
ssr(excludePaths: string[]) { ssr(excludePaths: string[]) {
let index = ''; let index = '';
try { try {
+3
View File
@@ -40,6 +40,7 @@ export class AppService {
async init() { async init() {
await this.databaseService.init(); await this.databaseService.init();
await this.configService.init(); await this.configService.init();
await this.libraryService.init();
await this.jobService.init({ await this.jobService.init({
[JobName.ASSET_DELETION]: (data) => this.assetService.handleAssetDeletion(data), [JobName.ASSET_DELETION]: (data) => this.assetService.handleAssetDeletion(data),
[JobName.ASSET_DELETION_CHECK]: () => this.assetService.handleAssetDeletionCheck(), [JobName.ASSET_DELETION_CHECK]: () => this.assetService.handleAssetDeletionCheck(),
@@ -86,6 +87,8 @@ export class AppService {
} }
async teardown() { async teardown() {
await this.libraryService.unwatchAll();
await this.metadataService.teardown(); await this.metadataService.teardown();
} }
} }
-1
View File
@@ -131,7 +131,6 @@ export const testApp = {
teardown: async () => { teardown: async () => {
if (app) { if (app) {
await app.get(MicroAppService).teardown(); await app.get(MicroAppService).teardown();
await app.get(AppService).teardown();
await app.close(); await app.close();
} }
await db.disconnect(); await db.disconnect();