2021-02-26 14:22:25 +01:00
|
|
|
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
|
2021-02-26 16:26:27 +01:00
|
|
|
logger.info('Processing actor keys in job %d.', job.id)
|
2021-02-26 14:22:25 +01:00
|
|
|
|
|
|
|
const actor = await ActorModel.load(payload.actorId)
|
|
|
|
|
|
|
|
await generateAndSaveActorKeys(actor)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
processActorKeys
|
|
|
|
}
|