aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/actors
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-19 15:42:29 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 10:19:55 +0200
commitcf069671f44a4b03d6d5d34f17160b2253f29654 (patch)
treecbdab0f8229b20fe435cd9b052374d47aaf8f6f9 /server/lib/activitypub/actors
parent2b5dfa2fe00a433ff59c4ca922600f3d860e0903 (diff)
downloadPeerTube-cf069671f44a4b03d6d5d34f17160b2253f29654.tar.gz
PeerTube-cf069671f44a4b03d6d5d34f17160b2253f29654.tar.zst
PeerTube-cf069671f44a4b03d6d5d34f17160b2253f29654.zip
Use promise cache to load remote thumbnails
Diffstat (limited to 'server/lib/activitypub/actors')
-rw-r--r--server/lib/activitypub/actors/refresh.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/activitypub/actors/refresh.ts b/server/lib/activitypub/actors/refresh.ts
index 6d8428d66..d15cb5e90 100644
--- a/server/lib/activitypub/actors/refresh.ts
+++ b/server/lib/activitypub/actors/refresh.ts
@@ -1,5 +1,5 @@
1import { logger, loggerTagsFactory } from '@server/helpers/logger' 1import { logger, loggerTagsFactory } from '@server/helpers/logger'
2import { PromiseCache } from '@server/helpers/promise-cache' 2import { CachePromiseFactory } from '@server/helpers/promise-cache'
3import { PeerTubeRequestError } from '@server/helpers/requests' 3import { PeerTubeRequestError } from '@server/helpers/requests'
4import { ActorLoadByUrlType } from '@server/lib/model-loaders' 4import { ActorLoadByUrlType } from '@server/lib/model-loaders'
5import { ActorModel } from '@server/models/actor/actor' 5import { ActorModel } from '@server/models/actor/actor'
@@ -16,7 +16,7 @@ type RefreshOptions <T> = {
16 fetchedType: ActorLoadByUrlType 16 fetchedType: ActorLoadByUrlType
17} 17}
18 18
19const promiseCache = new PromiseCache(doRefresh, (options: RefreshOptions<MActorFull | MActorAccountChannelId>) => options.actor.url) 19const promiseCache = new CachePromiseFactory(doRefresh, (options: RefreshOptions<MActorFull | MActorAccountChannelId>) => options.actor.url)
20 20
21function refreshActorIfNeeded <T extends MActorFull | MActorAccountChannelId> (options: RefreshOptions<T>): RefreshResult <T> { 21function refreshActorIfNeeded <T extends MActorFull | MActorAccountChannelId> (options: RefreshOptions<T>): RefreshResult <T> {
22 const actorArg = options.actor 22 const actorArg = options.actor