diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-26 14:22:25 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-26 14:22:25 +0100 |
commit | 8795d6f254bd8f88c385bf77b82cc6f177c94df9 (patch) | |
tree | 88f8f4fced9e0c12db5b43dcac6e44bd94eb8b1a /server/lib/job-queue/handlers | |
parent | 92315d979c3f424d81f8fca3c8831d81e4e2a6d6 (diff) | |
download | PeerTube-8795d6f254bd8f88c385bf77b82cc6f177c94df9.tar.gz PeerTube-8795d6f254bd8f88c385bf77b82cc6f177c94df9.tar.zst PeerTube-8795d6f254bd8f88c385bf77b82cc6f177c94df9.zip |
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
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r-- | server/lib/job-queue/handlers/actor-keys.ts | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ | |||
1 | import * as Bull from 'bull' | ||
2 | import { generateAndSaveActorKeys } from '@server/lib/activitypub/actor' | ||
3 | import { ActorModel } from '@server/models/activitypub/actor' | ||
4 | import { ActorKeysPayload } from '@shared/models' | ||
5 | import { logger } from '../../../helpers/logger' | ||
6 | |||
7 | async function processActorKeys (job: Bull.Job) { | ||
8 | const payload = job.data as ActorKeysPayload | ||
9 | logger.info('Processing email in job %d.', job.id) | ||
10 | |||
11 | const actor = await ActorModel.load(payload.actorId) | ||
12 | |||
13 | await generateAndSaveActorKeys(actor) | ||
14 | } | ||
15 | |||
16 | // --------------------------------------------------------------------------- | ||
17 | |||
18 | export { | ||
19 | processActorKeys | ||
20 | } | ||