Added config flag to disable recommendations service (#20879)

no ref

This service can get rather noisy when doing local development with our
data generator, as we do not use real urls, and therefore generate a lot
of not found errors in the console.
This commit is contained in:
Steve Larson 2024-08-29 12:51:23 -05:00 committed by GitHub
parent 79f4b523ac
commit c2ae91e4db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,11 +39,16 @@ class RecommendationServiceWrapper {
incomingRecommendationService;
init() {
const config = require('../../../shared/config');
if (config.get('services:recommendations:enabled') === false) {
logging.info('[Recommendations] Service is disabled via config');
return;
}
if (this.repository) {
return;
}
const config = require('../../../shared/config');
const urlUtils = require('../../../shared/url-utils');
const models = require('../../models');
const sentry = require('../../../shared/sentry');