]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/lib/job-queue/handlers/actor-keys.ts
Use bullmq job dependency
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / actor-keys.ts
CommitLineData
5a921e7b 1import { Job } from 'bullmq'
136d7efd 2import { generateAndSaveActorKeys } from '@server/lib/activitypub/actors'
7d9ba5c0 3import { ActorModel } from '@server/models/actor/actor'
8795d6f2
C
4import { ActorKeysPayload } from '@shared/models'
5import { logger } from '../../../helpers/logger'
6
41fb13c3 7async 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
18export {
19 processActorKeys
20}