aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/actor-keys.ts
blob: 9d5a65376a3982e72c1b7bd12b43db726d089381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Job } from 'bull'
import { generateAndSaveActorKeys } from '@server/lib/activitypub/actors'
import { ActorModel } from '@server/models/actor/actor'
import { ActorKeysPayload } from '@shared/models'
import { logger } from '../../../helpers/logger'

async function processActorKeys (job: 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
}