fix(cli): clean up set intervals (#2103)
This commit is contained in:
parent
da5a6d2272
commit
8563bd463c
1 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import { DynamicModule, Global, Module, ModuleMetadata, Provider } from '@nestjs/common';
|
||||
import { DynamicModule, Global, Module, ModuleMetadata, OnApplicationShutdown, Provider } from '@nestjs/common';
|
||||
import { AlbumService } from './album';
|
||||
import { APIKeyService } from './api-key';
|
||||
import { AssetService } from './asset';
|
||||
|
@ -44,7 +44,9 @@ const providers: Provider[] = [
|
|||
|
||||
@Global()
|
||||
@Module({})
|
||||
export class DomainModule {
|
||||
export class DomainModule implements OnApplicationShutdown {
|
||||
constructor(private searchService: SearchService) {}
|
||||
|
||||
static register(options: Pick<ModuleMetadata, 'imports'>): DynamicModule {
|
||||
return {
|
||||
module: DomainModule,
|
||||
|
@ -53,4 +55,8 @@ export class DomainModule {
|
|||
exports: [...providers],
|
||||
};
|
||||
}
|
||||
|
||||
onApplicationShutdown() {
|
||||
this.searchService.teardown();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue