]>
Commit | Line | Data |
---|---|---|
5a921e7b | 1 | import { Job } from 'bullmq' |
136d7efd | 2 | import { generateAndSaveActorKeys } from '@server/lib/activitypub/actors' |
7d9ba5c0 | 3 | import { ActorModel } from '@server/models/actor/actor' |
8795d6f2 C |
4 | import { ActorKeysPayload } from '@shared/models' |
5 | import { logger } from '../../../helpers/logger' | |
6 | ||
41fb13c3 | 7 | async function processActorKeys (job: Job) { |
8795d6f2 | 8 | const payload = job.data as ActorKeysPayload |
bd911b54 | 9 | logger.info('Processing actor keys in job %s.', job.id) |
8795d6f2 C |
10 | |
11 | const actor = await ActorModel.load(payload.actorId) | |
12 | ||
13 | await generateAndSaveActorKeys(actor) | |
14 | } | |
15 | ||
16 | // --------------------------------------------------------------------------- | |
17 | ||
18 | export { | |
19 | processActorKeys | |
20 | } |