Generate account and channel keys concurrently
Bump UV_THREADPOOL_SIZE in the systemd templates, since password hashing happens in libuv thread pool
This commit is contained in:
3 files changed
+9
-3
No files matched your search
@@ -9,6 +9,7 @@ import {
|
||||
UserRoleType
|
||||
} from '@peertube/peertube-models'
|
||||
import { createLogger } from '@server/helpers/logger.js'
|
||||
import { createPrivateAndPublicKeys } from '@server/helpers/peertube-crypto.js'
|
||||
import { CONFIG } from '@server/initializers/config.js'
|
||||
import { UserModel } from '@server/models/user/user.js'
|
||||
import { Transaction } from 'sequelize'
|
||||
@@ -26,7 +27,6 @@ import { buildActorInstance, findAvailableLocalActorName } from './local-actor.j
|
||||
import { Redis } from './redis/index.js'
|
||||
import { createLocalVideoChannelWithoutKeys } from './video-channel.js'
|
||||
import { createWatchLaterPlaylist } from './video-playlist.js'
|
||||
import { createPrivateAndPublicKeys } from '@server/helpers/peertube-crypto.js'
|
||||
|
||||
const logger = createLogger()
|
||||
|
||||
@@ -100,8 +100,10 @@ export async function createUserAccountAndChannelAndPlaylist (parameters: {
|
||||
}): Promise<{ user: MUserDefault, account: MAccountDefault, videoChannel: MChannelActor }> {
|
||||
const { userToCreate, userDisplayName, channelNames, validateUser = true } = parameters
|
||||
|
||||
const accountKeys = await createPrivateAndPublicKeys()
|
||||
const channelKeys = await createPrivateAndPublicKeys()
|
||||
const [ accountKeys, channelKeys ] = await Promise.all([
|
||||
createPrivateAndPublicKeys(),
|
||||
createPrivateAndPublicKeys()
|
||||
])
|
||||
|
||||
return sequelizeTypescript.transaction(async t => {
|
||||
const userOptions = {
|
||||
|
||||
@@ -15,6 +15,8 @@ Type=simple
|
||||
Environment=NODE_ENV=production
|
||||
Environment=NODE_CONFIG_DIR=/var/www/peertube/config
|
||||
Environment=NODE_APP_INSTANCE=secondary-%i
|
||||
; Password hashing and actor key generation run on the libuv thread pool, which defaults to 4 threads
|
||||
Environment=UV_THREADPOOL_SIZE=8
|
||||
User=peertube
|
||||
Group=peertube
|
||||
ExecStart=/usr/bin/node dist/server --role=secondary
|
||||
|
||||
@@ -6,6 +6,8 @@ After=network.target postgresql.service redis-server.service
|
||||
Type=simple
|
||||
Environment=NODE_ENV=production
|
||||
Environment=NODE_CONFIG_DIR=/var/www/peertube/config
|
||||
; Password hashing and actor key generation run on the libuv thread pool, which defaults to 4 threads
|
||||
Environment=UV_THREADPOOL_SIZE=16
|
||||
User=peertube
|
||||
Group=peertube
|
||||
ExecStart=/usr/bin/node dist/server
|
||||
|
||||
Reference in new issue
Block a user