mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: closes #13180, don't execute cron jobs if ap disabled
This commit is contained in:
@@ -59,6 +59,9 @@ ActivityPub.instances = require('./instances');
|
|||||||
ActivityPub.startJobs = () => {
|
ActivityPub.startJobs = () => {
|
||||||
ActivityPub.helpers.log('[activitypub/jobs] Registering jobs.');
|
ActivityPub.helpers.log('[activitypub/jobs] Registering jobs.');
|
||||||
new CronJob('0 0 * * *', async () => {
|
new CronJob('0 0 * * *', async () => {
|
||||||
|
if (!meta.config.activitypubEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await ActivityPub.notes.prune();
|
await ActivityPub.notes.prune();
|
||||||
await db.sortedSetsRemoveRangeByScore(['activities:datetime'], '-inf', Date.now() - 604800000);
|
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
|
}, null, true, null, null, false); // change last argument to true for debugging
|
||||||
|
|
||||||
new CronJob('*/30 * * * *', async () => {
|
new CronJob('*/30 * * * *', async () => {
|
||||||
|
if (!meta.config.activitypubEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await ActivityPub.actors.prune();
|
await ActivityPub.actors.prune();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user