X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fmodel-cache.ts;h=eafb5c13ce5e82521bade4749aaea9d1c8560db5;hb=6939cbac48e0a9823b34577836480ae3c28186be;hp=8afe3834fb755c8d6e47324d7ba8423d601396a4;hpb=7eba5e1fa81c8e54cb8fe298a96e8070afa50921;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/model-cache.ts b/server/models/model-cache.ts index 8afe3834f..eafb5c13c 100644 --- a/server/models/model-cache.ts +++ b/server/models/model-cache.ts @@ -6,7 +6,8 @@ type ModelCacheType = 'local-account-name' | 'local-actor-name' | 'local-actor-url' - | 'video-immutable' + | 'load-video-immutable-id' + | 'load-video-immutable-url' type DeleteKey = 'video' @@ -19,7 +20,8 @@ class ModelCache { 'local-account-name': new Map(), 'local-actor-name': new Map(), 'local-actor-url': new Map(), - 'video-immutable': new Map() + 'load-video-immutable-id': new Map(), + 'load-video-immutable-url': new Map() } private readonly deleteIds: { @@ -38,7 +40,7 @@ class ModelCache { doCache (options: { cacheType: ModelCacheType key: string - fun: () => Bluebird + fun: () => Promise whitelist?: () => boolean deleteKey?: DeleteKey }) {