diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 88f915691d..b5a70752d1 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -61,6 +61,9 @@ ActivityPub.feps = require('./feps'); ActivityPub.startJobs = () => { ActivityPub.helpers.log('[activitypub/jobs] Registering jobs.'); new CronJob('0 0 * * *', async () => { + if (!meta.config.activitypubEnabled) { + return; + } try { await ActivityPub.notes.prune(); await db.sortedSetsRemoveRangeByScore(['activities:datetime'], '-inf', Date.now() - 604800000); @@ -70,6 +73,9 @@ ActivityPub.startJobs = () => { }, null, true, null, null, false); // change last argument to true for debugging new CronJob('*/30 * * * *', async () => { + if (!meta.config.activitypubEnabled) { + return; + } try { await ActivityPub.actors.prune(); } catch (err) {