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

Use got instead of request

This commit is contained in:
Chocobozzz 2021-03-08 14:24:11 +01:00
parent 71926aae07
commit db4b15f21f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
32 changed files with 346 additions and 328 deletions

View file

@ -16,8 +16,7 @@ async function processActivityPubHttpBroadcast (job: Bull.Job) {
const httpSignatureOptions = await buildSignedRequestOptions(payload)
const options = {
method: 'POST',
uri: '',
method: 'POST' as 'POST',
json: body,
httpSignature: httpSignatureOptions,
timeout: REQUEST_TIMEOUT,
@ -28,7 +27,7 @@ async function processActivityPubHttpBroadcast (job: Bull.Job) {
const goodUrls: string[] = []
await Bluebird.map(payload.uris, uri => {
return doRequest(Object.assign({}, options, { uri }))
return doRequest(uri, options)
.then(() => goodUrls.push(uri))
.catch(() => badUrls.push(uri))
}, { concurrency: BROADCAST_CONCURRENCY })