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:
parent
4707f410ae
commit
2f5c6b2fc6
14 changed files with 118 additions and 73 deletions
|
@ -1,9 +1,9 @@
|
|||
import * as Bull from 'bull'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { doRequest } from '../../../helpers/requests'
|
||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
|
||||
import { JOB_REQUEST_TIMEOUT } from '../../../initializers'
|
||||
import { ActorFollowScoreCache } from '../../cache'
|
||||
|
||||
export type ActivitypubHttpUnicastPayload = {
|
||||
uri: string
|
||||
|
@ -31,9 +31,9 @@ async function processActivityPubHttpUnicast (job: Bull.Job) {
|
|||
|
||||
try {
|
||||
await doRequest(options)
|
||||
ActorFollowModel.updateActorFollowsScore([ uri ], [], undefined)
|
||||
ActorFollowScoreCache.Instance.updateActorFollowsScore([ uri ], [])
|
||||
} catch (err) {
|
||||
ActorFollowModel.updateActorFollowsScore([], [ uri ], undefined)
|
||||
ActorFollowScoreCache.Instance.updateActorFollowsScore([], [ uri ])
|
||||
|
||||
throw err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue