From a15871560f80e07386c1dabb8370cd2664ecfd1f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 31 Jan 2020 16:56:52 +0100 Subject: Move to eslint --- server/lib/activitypub/crawl.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/activitypub/crawl.ts') diff --git a/server/lib/activitypub/crawl.ts b/server/lib/activitypub/crawl.ts index 9e469e3e6..eeafdf4ba 100644 --- a/server/lib/activitypub/crawl.ts +++ b/server/lib/activitypub/crawl.ts @@ -3,7 +3,7 @@ import { doRequest } from '../../helpers/requests' import { logger } from '../../helpers/logger' import * as Bluebird from 'bluebird' import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub' -import { parse } from 'url' +import { URL } from 'url' type HandlerFunction = (items: T[]) => (Promise | Bluebird) type CleanerFunction = (startedDate: Date) => (Promise | Bluebird) @@ -24,7 +24,7 @@ async function crawlCollectionPage (uri: string, handler: HandlerFunction const response = await doRequest>(options) const firstBody = response.body - let limit = ACTIVITY_PUB.FETCH_PAGE_LIMIT + const limit = ACTIVITY_PUB.FETCH_PAGE_LIMIT let i = 0 let nextLink = firstBody.first while (nextLink && i < limit) { @@ -32,7 +32,7 @@ async function crawlCollectionPage (uri: string, handler: HandlerFunction if (typeof nextLink === 'string') { // Don't crawl ourselves - const remoteHost = parse(nextLink).host + const remoteHost = new URL(nextLink).host if (remoteHost === WEBSERVER.HOST) continue options.uri = nextLink -- cgit v1.2.3