mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Use got instead of request
This commit is contained in:
parent
71926aae07
commit
db4b15f21f
32 changed files with 346 additions and 328 deletions
|
@ -1,5 +1,5 @@
|
|||
import { chunk } from 'lodash'
|
||||
import { doRequest } from '@server/helpers/requests'
|
||||
import { doJSONRequest } from '@server/helpers/requests'
|
||||
import { JobQueue } from '@server/lib/job-queue'
|
||||
import { ActorFollowModel } from '@server/models/activitypub/actor-follow'
|
||||
import { getServerActor } from '@server/models/application/application'
|
||||
|
@ -34,12 +34,12 @@ export class AutoFollowIndexInstances extends AbstractScheduler {
|
|||
try {
|
||||
const serverActor = await getServerActor()
|
||||
|
||||
const qs = { count: 1000 }
|
||||
if (this.lastCheck) Object.assign(qs, { since: this.lastCheck.toISOString() })
|
||||
const searchParams = { count: 1000 }
|
||||
if (this.lastCheck) Object.assign(searchParams, { since: this.lastCheck.toISOString() })
|
||||
|
||||
this.lastCheck = new Date()
|
||||
|
||||
const { body } = await doRequest<any>({ uri: indexUrl, qs, json: true })
|
||||
const { body } = await doJSONRequest<any>(indexUrl, { searchParams })
|
||||
if (!body.data || Array.isArray(body.data) === false) {
|
||||
logger.error('Cannot auto follow instances of index %s. Please check the auto follow URL.', indexUrl, { body })
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue