1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Move to eslint

This commit is contained in:
Chocobozzz 2020-01-31 16:56:52 +01:00
parent a22046d166
commit a15871560f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
390 changed files with 3950 additions and 3615 deletions

View file

@ -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<T> = (items: T[]) => (Promise<any> | Bluebird<any>)
type CleanerFunction = (startedDate: Date) => (Promise<any> | Bluebird<any>)
@ -24,7 +24,7 @@ async function crawlCollectionPage <T> (uri: string, handler: HandlerFunction<T>
const response = await doRequest<ActivityPubOrderedCollection<T>>(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 <T> (uri: string, handler: HandlerFunction<T>
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