X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fjob-queue%2Fhandlers%2Factivitypub-http-unicast.ts;h=6b71e28916c82aa8dd2fa6d0b8a07dfc496458b2;hb=598edb8af1cc7e5ea3ead1ec9c96c4853b90be36;hp=d36479032849d5cfc635b54cf8e1cc188c09cdb3;hpb=729bb184819ddda1d7313da0c30b3397e5689721;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/job-queue/handlers/activitypub-http-unicast.ts b/server/lib/job-queue/handlers/activitypub-http-unicast.ts index d36479032..6b71e2891 100644 --- a/server/lib/job-queue/handlers/activitypub-http-unicast.ts +++ b/server/lib/job-queue/handlers/activitypub-http-unicast.ts @@ -1,14 +1,16 @@ 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 { JOB_REQUEST_TIMEOUT } from '../../../initializers/constants' +import { ActorFollowScoreCache } from '../../files-cache' +import { ContextType } from '@server/helpers/activitypub' export type ActivitypubHttpUnicastPayload = { uri: string signatureActorId?: number body: any + contextType?: ContextType } async function processActivityPubHttpUnicast (job: Bull.Job) { @@ -31,9 +33,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 }