Skip to content

Commit

Permalink
information added to the context
Browse files Browse the repository at this point in the history
  • Loading branch information
jrCleber committed Sep 4, 2024
1 parent a64817f commit 9a73494
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,9 @@ export async function AppModule(context: Map<string, any>) {

app.use(ErrorMiddle.appError, ErrorMiddle.pageNotFound);

app['close'] = async () => {
await repository.onModuleDestroy();
await providerFiles.onModuleDestroy();
};

context.set('app', server);
context.set('module:logger', logger);
context.set('module:repository', repository);
context.set('module:redisCache', providerFiles);
context.set('module:provider', providerFiles);
context.set('module:config', configService);
}
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export async function bootstrap() {
bootstrap();

process.on('SIGINT', async () => {
await context.get('app').close();
context.get('module:provider').onModuleDestroy();
context.get('module:repository').onModuleDestroy();
context.get('module:logger').warn('APP MODULE - OFF');
context.get('server:logger').warn('HTTP - OFF');
process.exit(0);
Expand Down

0 comments on commit 9a73494

Please sign in to comment.