mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Automatically remove bad followings
This commit is contained in:
parent
466e3f20a5
commit
6b9c966f64
14 changed files with 307 additions and 206 deletions
|
@ -7,6 +7,8 @@ class ActorFollowScoreCache {
|
|||
|
||||
private static instance: ActorFollowScoreCache
|
||||
private pendingFollowsScore: { [ url: string ]: number } = {}
|
||||
private pendingBadServer = new Set<number>()
|
||||
private pendingGoodServer = new Set<number>()
|
||||
|
||||
private constructor () {}
|
||||
|
||||
|
@ -32,7 +34,31 @@ class ActorFollowScoreCache {
|
|||
}
|
||||
}
|
||||
|
||||
getPendingFollowsScoreCopy () {
|
||||
addBadServerId (serverId: number) {
|
||||
this.pendingBadServer.add(serverId)
|
||||
}
|
||||
|
||||
getBadFollowingServerIds () {
|
||||
return Array.from(this.pendingBadServer)
|
||||
}
|
||||
|
||||
clearBadFollowingServerIds () {
|
||||
this.pendingBadServer = new Set<number>()
|
||||
}
|
||||
|
||||
addGoodServerId (serverId: number) {
|
||||
this.pendingGoodServer.add(serverId)
|
||||
}
|
||||
|
||||
getGoodFollowingServerIds () {
|
||||
return Array.from(this.pendingGoodServer)
|
||||
}
|
||||
|
||||
clearGoodFollowingServerIds () {
|
||||
this.pendingGoodServer = new Set<number>()
|
||||
}
|
||||
|
||||
getPendingFollowsScore () {
|
||||
return this.pendingFollowsScore
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue