Moved initiatialisation of the Recommendation services behind a feature flag (#18429)

no issue
This commit is contained in:
Sag 2023-10-02 16:00:30 -03:00 committed by GitHub
parent 2f09dd8880
commit 7cdf7ce82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,7 @@ class RecommendationServiceWrapper {
return;
}
const labs = require('../../../shared/labs');
const config = require('../../../shared/config');
const urlUtils = require('../../../shared/url-utils');
const models = require('../../models');
@ -124,8 +125,10 @@ class RecommendationServiceWrapper {
service: this.service
});
if (labs.isSet('recommendations')) {
this.service.init().catch(logging.error);
this.incomingRecommendationService.init().catch(logging.error);
}
const PATH_SUFFIX = '/.well-known/recommendations.json';
@ -143,8 +146,6 @@ class RecommendationServiceWrapper {
}
});
const labs = require('../../../shared/labs');
// Listen for incoming webmentions
DomainEvents.subscribe(MentionCreatedEvent, async (event) => {
if (labs.isSet('recommendations')) {