]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/utils.ts
Translated using Weblate (Polish)
[github/Chocobozzz/PeerTube.git] / server / helpers / utils.ts
index ba07eaaf342c450410f323982b48c5c217729aa1..7a4c781ccb8780f4ab6d51b693b945e620348721 100644 (file)
@@ -1,6 +1,6 @@
 import { ResultList } from '../../shared'
 import { ApplicationModel } from '../models/application/application'
-import { execPromise, execPromise2, pseudoRandomBytesPromise, sha256 } from './core-utils'
+import { execPromise, execPromise2, randomBytesPromise, sha256 } from './core-utils'
 import { logger } from './logger'
 import { join } from 'path'
 import { Instance as ParseTorrent } from 'parse-torrent'
@@ -14,7 +14,7 @@ function deleteFileAsync (path: string) {
 }
 
 async function generateRandomString (size: number) {
-  const raw = await pseudoRandomBytesPromise(size)
+  const raw = await randomBytesPromise(size)
 
   return raw.toString('hex')
 }
@@ -40,7 +40,7 @@ const getServerActor = memoizee(async function () {
   actor.Account = application.Account
 
   return actor
-})
+}, { promise: true })
 
 function generateVideoImportTmpPath (target: string | ParseTorrent) {
   const id = typeof target === 'string' ? target : target.infoHash