1
0
Fork 0
peertube/server/lib/job-queue/handlers/actor-keys.ts

21 lines
617 B
TypeScript
Raw Normal View History

2021-08-27 08:32:44 -04:00
import { Job } from 'bull'
2021-06-03 10:02:29 -04:00
import { generateAndSaveActorKeys } from '@server/lib/activitypub/actors'
2021-05-11 05:15:29 -04:00
import { ActorModel } from '@server/models/actor/actor'
import { ActorKeysPayload } from '@shared/models'
import { logger } from '../../../helpers/logger'
2021-08-27 08:32:44 -04:00
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
}