Rename request timeout

pull/3815/head
Chocobozzz 2021-03-03 10:10:55 +01:00
parent 67bd004d84
commit dcd75f786c
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 13 additions and 13 deletions

View File

@ -197,7 +197,7 @@ const JOB_PRIORITY = {
const BROADCAST_CONCURRENCY = 30 // How many requests in parallel we do in activitypub-http-broadcast job
const AP_CLEANER_CONCURRENCY = 10 // How many requests in parallel we do in activitypub-cleaner job
const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...)
const JOB_REQUEST_TIMEOUT = 7000 // 7 seconds
const REQUEST_TIMEOUT = 7000 // 7 seconds
const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days
const VIDEO_IMPORT_TIMEOUT = 1000 * 3600 // 1 hour
@ -869,7 +869,7 @@ export {
ABUSE_STATES,
VIDEO_CHANNELS,
LRU_CACHE,
JOB_REQUEST_TIMEOUT,
REQUEST_TIMEOUT,
USER_PASSWORD_RESET_LIFETIME,
USER_PASSWORD_CREATE_LIFETIME,
MEMOIZE_TTL,

View File

@ -1,4 +1,4 @@
import { ACTIVITY_PUB, JOB_REQUEST_TIMEOUT, WEBSERVER } from '../../initializers/constants'
import { ACTIVITY_PUB, REQUEST_TIMEOUT, WEBSERVER } from '../../initializers/constants'
import { doRequest } from '../../helpers/requests'
import { logger } from '../../helpers/logger'
import * as Bluebird from 'bluebird'
@ -16,7 +16,7 @@ async function crawlCollectionPage <T> (uri: string, handler: HandlerFunction<T>
uri,
json: true,
activityPub: true,
timeout: JOB_REQUEST_TIMEOUT
timeout: REQUEST_TIMEOUT
}
const startDate = new Date()

View File

@ -1,11 +1,11 @@
import * as Bull from 'bull'
import * as Bluebird from 'bluebird'
import * as Bull from 'bull'
import { ActivitypubHttpBroadcastPayload } from '@shared/models'
import { logger } from '../../../helpers/logger'
import { doRequest } from '../../../helpers/requests'
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
import { BROADCAST_CONCURRENCY, JOB_REQUEST_TIMEOUT } from '../../../initializers/constants'
import { BROADCAST_CONCURRENCY, REQUEST_TIMEOUT } from '../../../initializers/constants'
import { ActorFollowScoreCache } from '../../files-cache'
import { ActivitypubHttpBroadcastPayload } from '@shared/models'
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
async function processActivityPubHttpBroadcast (job: Bull.Job) {
logger.info('Processing ActivityPub broadcast in job %d.', job.id)
@ -20,7 +20,7 @@ async function processActivityPubHttpBroadcast (job: Bull.Job) {
uri: '',
json: body,
httpSignature: httpSignatureOptions,
timeout: JOB_REQUEST_TIMEOUT,
timeout: REQUEST_TIMEOUT,
headers: buildGlobalHeaders(body)
}

View File

@ -1,10 +1,10 @@
import * as Bull from 'bull'
import { ActivitypubHttpUnicastPayload } from '@shared/models'
import { logger } from '../../../helpers/logger'
import { doRequest } from '../../../helpers/requests'
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
import { JOB_REQUEST_TIMEOUT } from '../../../initializers/constants'
import { REQUEST_TIMEOUT } from '../../../initializers/constants'
import { ActorFollowScoreCache } from '../../files-cache'
import { ActivitypubHttpUnicastPayload } from '@shared/models'
import { buildGlobalHeaders, buildSignedRequestOptions, computeBody } from './utils/activitypub-http-utils'
async function processActivityPubHttpUnicast (job: Bull.Job) {
logger.info('Processing ActivityPub unicast in job %d.', job.id)
@ -20,7 +20,7 @@ async function processActivityPubHttpUnicast (job: Bull.Job) {
uri,
json: body,
httpSignature: httpSignatureOptions,
timeout: JOB_REQUEST_TIMEOUT,
timeout: REQUEST_TIMEOUT,
headers: buildGlobalHeaders(body)
}