From b49f22d8f9a52ab75fd38db2d377249eb58fa678 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Dec 2020 14:30:29 +0100 Subject: Upgrade sequelize to v6 --- .../job-queue/handlers/activitypub-http-fetcher.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'server/lib/job-queue') diff --git a/server/lib/job-queue/handlers/activitypub-http-fetcher.ts b/server/lib/job-queue/handlers/activitypub-http-fetcher.ts index a7c1a556c..e210ac3ef 100644 --- a/server/lib/job-queue/handlers/activitypub-http-fetcher.ts +++ b/server/lib/job-queue/handlers/activitypub-http-fetcher.ts @@ -1,19 +1,18 @@ import * as Bull from 'bull' -import * as Bluebird from 'bluebird' +import { ActivitypubHttpFetcherPayload, FetchType } from '@shared/models' import { logger } from '../../../helpers/logger' -import { processActivities } from '../../activitypub/process' -import { addVideoComments } from '../../activitypub/video-comments' -import { crawlCollectionPage } from '../../activitypub/crawl' -import { VideoModel } from '../../../models/video/video' -import { addVideoShares } from '../../activitypub/share' -import { createRates } from '../../activitypub/video-rates' -import { createAccountPlaylists } from '../../activitypub/playlist' import { AccountModel } from '../../../models/account/account' import { AccountVideoRateModel } from '../../../models/account/account-video-rate' -import { VideoShareModel } from '../../../models/video/video-share' +import { VideoModel } from '../../../models/video/video' import { VideoCommentModel } from '../../../models/video/video-comment' +import { VideoShareModel } from '../../../models/video/video-share' import { MAccountDefault, MVideoFullLight } from '../../../types/models' -import { ActivitypubHttpFetcherPayload, FetchType } from '@shared/models' +import { crawlCollectionPage } from '../../activitypub/crawl' +import { createAccountPlaylists } from '../../activitypub/playlist' +import { processActivities } from '../../activitypub/process' +import { addVideoShares } from '../../activitypub/share' +import { addVideoComments } from '../../activitypub/video-comments' +import { createRates } from '../../activitypub/video-rates' async function processActivityPubHttpFetcher (job: Bull.Job) { logger.info('Processing ActivityPub fetcher in job %d.', job.id) @@ -35,7 +34,7 @@ async function processActivityPubHttpFetcher (job: Bull.Job) { 'account-playlists': items => createAccountPlaylists(items, account) } - const cleanerType: { [ id in FetchType ]?: (crawlStartDate: Date) => Bluebird } = { + const cleanerType: { [ id in FetchType ]?: (crawlStartDate: Date) => Promise } = { 'video-likes': crawlStartDate => AccountVideoRateModel.cleanOldRatesOf(video.id, 'like' as 'like', crawlStartDate), 'video-dislikes': crawlStartDate => AccountVideoRateModel.cleanOldRatesOf(video.id, 'dislike' as 'dislike', crawlStartDate), 'video-shares': crawlStartDate => VideoShareModel.cleanOldSharesOf(video.id, crawlStartDate), -- cgit v1.2.3