- // Set account keys, this could be long so process after the account creation and do not block the client
- const { publicKey, privateKey } = await createPrivateAndPublicKeys()
- const actor = account.Actor
- actor.set('publicKey', publicKey)
- actor.set('privateKey', privateKey)
- actor.save().catch(err => logger.error('Cannot set public/private keys of actor %d.', actor.uuid, err))
+ const [ accountKeys, channelKeys ] = await Promise.all([
+ setAsyncActorKeys(account.Actor),
+ setAsyncActorKeys(videoChannel.Actor)
+ ])
+
+ account.Actor = accountKeys
+ videoChannel.Actor = channelKeys