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:
parent
e81f6ccf98
commit
9db437c815
10 changed files with 160 additions and 37 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue