]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/utils.ts
Tests for totalRepliesFromVideoAuthor
[github/Chocobozzz/PeerTube.git] / server / helpers / utils.ts
index 1464b147728e0cefbac7c7c4b6c97b24d7676ca3..4c6f200f86f91f07a2f18b9e37a3b2a1ab67a137 100644 (file)
@@ -19,7 +19,10 @@ async function generateRandomString (size: number) {
   return raw.toString('hex')
 }
 
-interface FormattableToJSON<U, V> { toFormattedJSON (args?: U): V }
+interface FormattableToJSON<U, V> {
+  toFormattedJSON (args?: U): V
+}
+
 function getFormattedObjects<U, V, T extends FormattableToJSON<U, V>> (objects: T[], objectsTotal: number, formattedArg?: U) {
   const formattedObjects = objects.map(o => o.toFormattedJSON(formattedArg))
 
@@ -37,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