From db4b15f21fbf4e33434e930ffc7fb768cdcf9d42 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Mar 2021 14:24:11 +0100 Subject: Use got instead of request --- server/lib/schedulers/auto-follow-index-instances.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/lib/schedulers') diff --git a/server/lib/schedulers/auto-follow-index-instances.ts b/server/lib/schedulers/auto-follow-index-instances.ts index f62f52f9c..0b8cd1389 100644 --- a/server/lib/schedulers/auto-follow-index-instances.ts +++ b/server/lib/schedulers/auto-follow-index-instances.ts @@ -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({ uri: indexUrl, qs, json: true }) + const { body } = await doJSONRequest(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 -- cgit v1.2.3