1
0
Fork 0
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:
Chocobozzz 2019-08-06 17:19:53 +02:00
parent 466e3f20a5
commit 6b9c966f64
No known key found for this signature in database
GPG key ID: 583A612D890159BE
14 changed files with 307 additions and 206 deletions

View file

@ -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
}