Disabled Collections sync when flag disabled

We've been seeing an increased number of database queries, which are potentially
caused by the collections syncing logic. Whilst we haven't narrowed the cause
down precisely we want to disable this logic unless the flag is enabled.
This commit is contained in:
Fabien "egg" O'Carroll 2023-08-03 11:08:25 +01:00
parent afce648fd7
commit 148cf059dc

View File

@ -2,6 +2,7 @@ const {
CollectionsService CollectionsService
} = require('@tryghost/collections'); } = require('@tryghost/collections');
const BookshelfCollectionsRepository = require('./BookshelfCollectionsRepository'); const BookshelfCollectionsRepository = require('./BookshelfCollectionsRepository');
const labs = require('../../../shared/labs');
let inited = false; let inited = false;
class CollectionsServiceWrapper { class CollectionsServiceWrapper {
@ -31,6 +32,9 @@ class CollectionsServiceWrapper {
} }
async init() { async init() {
if (!labs.isSet('collections')) {
return;
}
if (inited) { if (inited) {
return; return;
} }