1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Optimize actor follow scores modifications

This commit is contained in:
Chocobozzz 2018-12-20 14:31:11 +01:00
parent 4707f410ae
commit 2f5c6b2fc6
No known key found for this signature in database
GPG key ID: 583A612D890159BE
14 changed files with 118 additions and 73 deletions

View file

@ -5,6 +5,7 @@ import { doRequest } from '../../../helpers/requests'
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers'
import { ActorFollowScoreCache } from '../../cache'
export type ActivitypubHttpBroadcastPayload = {
uris: string[]
@ -38,7 +39,7 @@ async function processActivityPubHttpBroadcast (job: Bull.Job) {
.catch(() => badUrls.push(uri))
}, { concurrency: BROADCAST_CONCURRENCY })
return ActorFollowModel.updateActorFollowsScore(goodUrls, badUrls, undefined)
return ActorFollowScoreCache.Instance.updateActorFollowsScore(goodUrls, badUrls)
}
// ---------------------------------------------------------------------------