X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fjob-queue%2Fhandlers%2Factivitypub-http-broadcast.ts;h=0ff7b44a0af8f3df10b238ed00fcefafc2303b5e;hb=74dc3bca2b14f5fd3fe80c394dfc34177a46db77;hp=03a9e12a410e96900528b29cf30dbee164141c34;hpb=94831479f5facff9469540a3d49dd347b88bdf5a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/job-queue/handlers/activitypub-http-broadcast.ts b/server/lib/job-queue/handlers/activitypub-http-broadcast.ts index 03a9e12a4..0ff7b44a0 100644 --- a/server/lib/job-queue/handlers/activitypub-http-broadcast.ts +++ b/server/lib/job-queue/handlers/activitypub-http-broadcast.ts @@ -2,9 +2,9 @@ import * as Bull from 'bull' import * as Bluebird from 'bluebird' import { logger } from '../../../helpers/logger' import { doRequest } from '../../../helpers/requests' -import { ActorFollowModel } from '../../../models/activitypub/actor-follow' -import { buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils' -import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers' +import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils' +import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers/constants' +import { ActorFollowScoreCache } from '../../files-cache' export type ActivitypubHttpBroadcastPayload = { uris: string[] @@ -25,7 +25,8 @@ async function processActivityPubHttpBroadcast (job: Bull.Job) { uri: '', json: body, httpSignature: httpSignatureOptions, - timeout: JOB_REQUEST_TIMEOUT + timeout: JOB_REQUEST_TIMEOUT, + headers: buildGlobalHeaders(body) } const badUrls: string[] = [] @@ -37,7 +38,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) } // ---------------------------------------------------------------------------