Cleanup default values and leftover methods in environmentService (#4550)

* Cleanup default values and leftover methods in environmentService

* Adress remainings configService calls
This commit is contained in:
Félix Malfait
2024-03-18 17:09:39 +01:00
committed by GitHub
parent 1cc8bdd3e9
commit bdbd77c696
15 changed files with 110 additions and 172 deletions

View File

@ -1,8 +1,11 @@
import { ConfigService } from '@nestjs/config';
import { CommandFactory } from 'nest-commander';
import { filterException } from 'src/engine/filters/utils/global-exception-handler.util';
import { ExceptionHandlerService } from 'src/engine/integrations/exception-handler/exception-handler.service';
import { LoggerService } from 'src/engine/integrations/logger/logger.service';
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
import { CommandModule } from './command.module';
@ -17,8 +20,10 @@ async function bootstrap() {
exceptionHandlerService.captureExceptions([err]);
};
const environmentService = new EnvironmentService(new ConfigService());
const app = await CommandFactory.createWithoutRunning(CommandModule, {
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
bufferLogs: environmentService.get('LOGGER_IS_BUFFER_ENABLED'),
errorHandler,
serviceErrorHandler: errorHandler,
});