X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fjob-queue%2Fhandlers%2Factivitypub-cleaner.ts;h=d5e4508fea24a2a8e4c01c9dd54336f082e02b2e;hb=0882c8e6509b2a4ea48f6c48ecb2aa4aa371500a;hp=1caca1dcc04bb386d9c4efa7751bea6f85b964f9;hpb=4024c44f9027a32809931de0692d40d001df721c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/job-queue/handlers/activitypub-cleaner.ts b/server/lib/job-queue/handlers/activitypub-cleaner.ts index 1caca1dcc..d5e4508fe 100644 --- a/server/lib/job-queue/handlers/activitypub-cleaner.ts +++ b/server/lib/job-queue/handlers/activitypub-cleaner.ts @@ -1,5 +1,5 @@ -import * as Bluebird from 'bluebird' -import * as Bull from 'bull' +import { map } from 'bluebird' +import { Job } from 'bull' import { checkUrlsSameHost } from '@server/helpers/activitypub' import { isAnnounceActivityValid, @@ -12,20 +12,20 @@ import { AP_CLEANER_CONCURRENCY } from '@server/initializers/constants' import { VideoModel } from '@server/models/video/video' import { VideoCommentModel } from '@server/models/video/video-comment' import { VideoShareModel } from '@server/models/video/video-share' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' import { logger } from '../../../helpers/logger' import { AccountVideoRateModel } from '../../../models/account/account-video-rate' // Job to clean remote interactions off local videos -async function processActivityPubCleaner (_job: Bull.Job) { +async function processActivityPubCleaner (_job: Job) { logger.info('Processing ActivityPub cleaner.') { const rateUrls = await AccountVideoRateModel.listRemoteRateUrlsOfLocalVideos() const { bodyValidator, deleter, updater } = rateOptionsFactory() - await Bluebird.map(rateUrls, async rateUrl => { + await map(rateUrls, async rateUrl => { try { const result = await updateObjectIfNeeded(rateUrl, bodyValidator, updater, deleter) @@ -44,7 +44,7 @@ async function processActivityPubCleaner (_job: Bull.Job) { const shareUrls = await VideoShareModel.listRemoteShareUrlsOfLocalVideos() const { bodyValidator, deleter, updater } = shareOptionsFactory() - await Bluebird.map(shareUrls, async shareUrl => { + await map(shareUrls, async shareUrl => { try { await updateObjectIfNeeded(shareUrl, bodyValidator, updater, deleter) } catch (err) { @@ -57,7 +57,7 @@ async function processActivityPubCleaner (_job: Bull.Job) { const commentUrls = await VideoCommentModel.listRemoteCommentUrlsOfLocalVideos() const { bodyValidator, deleter, updater } = commentOptionsFactory() - await Bluebird.map(commentUrls, async commentUrl => { + await map(commentUrls, async commentUrl => { try { await updateObjectIfNeeded(commentUrl, bodyValidator, updater, deleter) } catch (err) {