diff options
Diffstat (limited to 'server/lib/files-cache')
-rw-r--r-- | server/lib/files-cache/actor-follow-score-cache.ts | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/server/lib/files-cache/actor-follow-score-cache.ts b/server/lib/files-cache/actor-follow-score-cache.ts index 5f8ee806f..086605726 100644 --- a/server/lib/files-cache/actor-follow-score-cache.ts +++ b/server/lib/files-cache/actor-follow-score-cache.ts | |||
@@ -7,6 +7,8 @@ class ActorFollowScoreCache { | |||
7 | 7 | ||
8 | private static instance: ActorFollowScoreCache | 8 | private static instance: ActorFollowScoreCache |
9 | private pendingFollowsScore: { [ url: string ]: number } = {} | 9 | private pendingFollowsScore: { [ url: string ]: number } = {} |
10 | private pendingBadServer = new Set<number>() | ||
11 | private pendingGoodServer = new Set<number>() | ||
10 | 12 | ||
11 | private constructor () {} | 13 | private constructor () {} |
12 | 14 | ||
@@ -32,7 +34,31 @@ class ActorFollowScoreCache { | |||
32 | } | 34 | } |
33 | } | 35 | } |
34 | 36 | ||
35 | getPendingFollowsScoreCopy () { | 37 | addBadServerId (serverId: number) { |
38 | this.pendingBadServer.add(serverId) | ||
39 | } | ||
40 | |||
41 | getBadFollowingServerIds () { | ||
42 | return Array.from(this.pendingBadServer) | ||
43 | } | ||
44 | |||
45 | clearBadFollowingServerIds () { | ||
46 | this.pendingBadServer = new Set<number>() | ||
47 | } | ||
48 | |||
49 | addGoodServerId (serverId: number) { | ||
50 | this.pendingGoodServer.add(serverId) | ||
51 | } | ||
52 | |||
53 | getGoodFollowingServerIds () { | ||
54 | return Array.from(this.pendingGoodServer) | ||
55 | } | ||
56 | |||
57 | clearGoodFollowingServerIds () { | ||
58 | this.pendingGoodServer = new Set<number>() | ||
59 | } | ||
60 | |||
61 | getPendingFollowsScore () { | ||
36 | return this.pendingFollowsScore | 62 | return this.pendingFollowsScore |
37 | } | 63 | } |
38 | 64 | ||