move watcher init to micro
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user