X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fcrawl.ts;h=336129b822013a0e3e01786069d6923005d1de27;hb=0c302acb3c358b4d4d8dee45aed1de1108ea37ea;hp=28ff5225a01bde45b7ddf7b0e5086487bc713386;hpb=c4fa01f7c45b66b112ebd08abce744b7c4041feb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/crawl.ts b/server/lib/activitypub/crawl.ts index 28ff5225a..336129b82 100644 --- a/server/lib/activitypub/crawl.ts +++ b/server/lib/activitypub/crawl.ts @@ -1,13 +1,13 @@ -import { retryTransactionWrapper } from '@server/helpers/database-utils' -import * as Bluebird from 'bluebird' +import Bluebird from 'bluebird' import { URL } from 'url' +import { retryTransactionWrapper } from '@server/helpers/database-utils' import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub' import { logger } from '../../helpers/logger' import { doJSONRequest } from '../../helpers/requests' import { ACTIVITY_PUB, WEBSERVER } from '../../initializers/constants' type HandlerFunction = (items: T[]) => (Promise | Bluebird) -type CleanerFunction = (startedDate: Date) => (Promise | Bluebird) +type CleanerFunction = (startedDate: Date) => Promise async function crawlCollectionPage (argUrl: string, handler: HandlerFunction, cleaner?: CleanerFunction) { let url = argUrl