aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/lib/job-queue/handlers/actor-keys.ts
blob: 3eef565d032d1ce87313137f7850ebf657255250 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                                        
                                                       




                                                 
                                                         










                                                                              
import * as Bull from 'bull'
import { generateAndSaveActorKeys } from '@server/lib/activitypub/actor'
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
}