diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 1ab36c3773..eb60b7a1a6 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -59,6 +59,9 @@ ActivityPub.instances = require('./instances'); 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); @@ -68,6 +71,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) {