PeerTube/server/lib/job-queue/handlers/actor-keys.ts

21 lines
624 B
TypeScript
Raw Normal View History

import * as Bull from 'bull'
2021-06-03 09:02:29 -05:00
import { generateAndSaveActorKeys } from '@server/lib/activitypub/actors'
2021-05-11 04:15:29 -05:00
import { ActorModel } from '@server/models/actor/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 actor keys in job %d.', job.id)
const actor = await ActorModel.load(payload.actorId)
await generateAndSaveActorKeys(actor)
}
// ---------------------------------------------------------------------------
export {
processActorKeys
}