1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Process slow followers in unicast job queue

This commit is contained in:
Chocobozzz 2021-10-13 11:47:32 +02:00
parent e81f6ccf98
commit 9db437c815
No known key found for this signature in database
GPG key ID: 583A612D890159BE
10 changed files with 160 additions and 37 deletions

View file

@ -2,7 +2,7 @@ import { Job } from 'bull'
import { ActivitypubHttpUnicastPayload } from '@shared/models'
import { logger } from '../../../helpers/logger'
import { doRequest } from '../../../helpers/requests'
import { ActorFollowScoreCache } from '../../files-cache'
import { ActorFollowHealthCache } from '../../actor-follow-health-cache'
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
async function processActivityPubHttpUnicast (job: Job) {
@ -23,9 +23,9 @@ async function processActivityPubHttpUnicast (job: Job) {
try {
await doRequest(uri, options)
ActorFollowScoreCache.Instance.updateActorFollowsScore([ uri ], [])
ActorFollowHealthCache.Instance.updateActorFollowsHealth([ uri ], [])
} catch (err) {
ActorFollowScoreCache.Instance.updateActorFollowsScore([], [ uri ])
ActorFollowHealthCache.Instance.updateActorFollowsHealth([], [ uri ])
throw err
}