diff --git a/src/config.ts b/src/config.ts index 0dd7162..b9373e5 100644 --- a/src/config.ts +++ b/src/config.ts @@ -69,5 +69,5 @@ export const FACE_VALIDATION_ENABLED = !!FACE_VALIDATION_URL; export const ABUSIVE_DETECTION_URL = process.env.ABUSIVE_DETECTION_URL; export const ABUSIVE_DETECTION_ENABLED = !!ABUSIVE_DETECTION_URL; -export const RECOMMENDATION_URL = process.env.RECOMMENDATION_URL; -export const RECOMMENDATION_ENABLED = !!RECOMMENDATION_URL; +export const SYSTEM_RECOMMENDER_URL = process.env.SYSTEM_RECOMMENDER_URL; +export const SYSTEM_RECOMMENDER_ENABLED = !!SYSTEM_RECOMMENDER_URL; diff --git a/src/module/recommendation/recommendation.factory.ts b/src/module/recommendation/recommendation.factory.ts index 24e6a99..9277d05 100644 --- a/src/module/recommendation/recommendation.factory.ts +++ b/src/module/recommendation/recommendation.factory.ts @@ -1,4 +1,4 @@ -import { RECOMMENDATION_ENABLED, RECOMMENDATION_URL } from "@/config"; +import { SYSTEM_RECOMMENDER_ENABLED, SYSTEM_RECOMMENDER_URL } from "@/config"; import { RemoteRecommendationService, InterestRecommendationService, @@ -12,7 +12,7 @@ export const createRecommendationService = ( learnerRepository: LearnerRepository, tutoriesRepository: TutoriesRepository, ) => { - if (process.env.NODE_ENV === "test" || !RECOMMENDATION_ENABLED) { + if (process.env.NODE_ENV === "test" || !SYSTEM_RECOMMENDER_ENABLED) { logger.info( "Recommendation service is disabled, using simple interest-matching service", ); @@ -22,11 +22,11 @@ export const createRecommendationService = ( ); } - const service = new RemoteRecommendationService(RECOMMENDATION_URL!); + const service = new RemoteRecommendationService(SYSTEM_RECOMMENDER_URL!); try { axios - .get(`${RECOMMENDATION_URL}/health`, { + .get(`${SYSTEM_RECOMMENDER_URL}/health`, { timeout: 5000, }) .catch(() => {