diff --git a/src/activitypub/actors.js b/src/activitypub/actors.js index b9feb2b72b..169e55dd09 100644 --- a/src/activitypub/actors.js +++ b/src/activitypub/actors.js @@ -279,8 +279,12 @@ Actors.prune = async () => { const count = counts[idx]; if (count < 1) { - await user.deleteAccount(uid); - deletionCount += 1; + try { + await user.deleteAccount(uid); + deletionCount += 1; + } catch (err) { + winston.error(err.stack); + } } else { reassertionSet.add(uid); } diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 055be9d895..91e05aa619 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -44,8 +44,21 @@ ActivityPub.actors = require('./actors'); ActivityPub.startJobs = () => { // winston.verbose('[activitypub/jobs] Registering jobs.'); - new CronJob('0 0 * * *', ActivityPub.notes.prune, null, true, null, null, false); // change last argument to true for debugging - new CronJob('0 1 * * *', ActivityPub.actors.prune, null, true, null, null, false); // change last argument to true for debugging + new CronJob('0 0 * * *', async () => { + try { + await ActivityPub.notes.prune(); + } catch (err) { + winston.error(err.stack); + } + }, null, true, null, null, false); // change last argument to true for debugging + + new CronJob('0 1 * * *', async () => { + try { + await ActivityPub.actors.prune(); + } catch (err) { + winston.error(err.stack); + } + },, null, true, null, null, false); // change last argument to true for debugging }; ActivityPub.resolveId = async (uid, id) => {