Refacto environment service (#4473)

* Refacto environment service

* Remove environment variable type
This commit is contained in:
Félix Malfait
2024-03-14 11:51:19 +01:00
committed by GitHub
parent 3caf860848
commit fd06d52a13
42 changed files with 320 additions and 480 deletions

View File

@ -12,7 +12,7 @@ import {
export const messageQueueModuleFactory = async (
environmentService: EnvironmentService,
): Promise<MessageQueueModuleOptions> => {
const driverType = environmentService.getMessageQueueDriverType();
const driverType = environmentService.get('MESSAGE_QUEUE_TYPE');
switch (driverType) {
case MessageQueueDriverType.Sync: {
@ -22,7 +22,7 @@ export const messageQueueModuleFactory = async (
};
}
case MessageQueueDriverType.PgBoss: {
const connectionString = environmentService.getPGDatabaseUrl();
const connectionString = environmentService.get('PG_DATABASE_URL');
return {
type: MessageQueueDriverType.PgBoss,
@ -32,8 +32,8 @@ export const messageQueueModuleFactory = async (
};
}
case MessageQueueDriverType.BullMQ: {
const host = environmentService.getRedisHost();
const port = environmentService.getRedisPort();
const host = environmentService.get('REDIS_HOST');
const port = environmentService.get('REDIS_PORT');
return {
type: MessageQueueDriverType.BullMQ,