From 8795d6f254bd8f88c385bf77b82cc6f177c94df9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 26 Feb 2021 14:22:25 +0100 Subject: Fix broken local actors Some channels can't federate because they don't have public/private keys, maybe because the generation failed for various reasons --- server/lib/job-queue/handlers/actor-keys.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 server/lib/job-queue/handlers/actor-keys.ts (limited to 'server/lib/job-queue/handlers') diff --git a/server/lib/job-queue/handlers/actor-keys.ts b/server/lib/job-queue/handlers/actor-keys.ts new file mode 100644 index 000000000..8da549640 --- /dev/null +++ b/server/lib/job-queue/handlers/actor-keys.ts @@ -0,0 +1,20 @@ +import * as Bull from 'bull' +import { generateAndSaveActorKeys } from '@server/lib/activitypub/actor' +import { ActorModel } from '@server/models/activitypub/actor' +import { ActorKeysPayload } from '@shared/models' +import { logger } from '../../../helpers/logger' + +async function processActorKeys (job: Bull.Job) { + const payload = job.data as ActorKeysPayload + logger.info('Processing email in job %d.', job.id) + + const actor = await ActorModel.load(payload.actorId) + + await generateAndSaveActorKeys(actor) +} + +// --------------------------------------------------------------------------- + +export { + processActorKeys +} -- cgit v1.2.3