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

Add timeout and TTL to request jobs

This commit is contained in:
Chocobozzz 2018-05-09 09:08:22 +02:00
parent 7797350a0e
commit 71e3dfda4e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 33 additions and 14 deletions

View file

@ -4,7 +4,7 @@ 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 } from '../../../initializers'
import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers'
export type ActivitypubHttpBroadcastPayload = {
uris: string[]
@ -24,7 +24,8 @@ async function processActivityPubHttpBroadcast (job: kue.Job) {
method: 'POST',
uri: '',
json: body,
httpSignature: httpSignatureOptions
httpSignature: httpSignatureOptions,
timeout: JOB_REQUEST_TIMEOUT
}
const badUrls: string[] = []