mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
esModuleInterop to true
This commit is contained in:
parent
40e7ed0714
commit
41fb13c330
208 changed files with 444 additions and 425 deletions
|
@ -1,4 +1,4 @@
|
|||
import * as Bull from 'bull'
|
||||
import Bull, { Job, JobOptions, Queue } from 'bull'
|
||||
import { jobStates } from '@server/helpers/custom-validators/jobs'
|
||||
import { CONFIG } from '@server/initializers/config'
|
||||
import { processVideoRedundancy } from '@server/lib/job-queue/handlers/video-redundancy'
|
||||
|
@ -30,12 +30,12 @@ import { processActivityPubHttpUnicast } from './handlers/activitypub-http-unica
|
|||
import { refreshAPObject } from './handlers/activitypub-refresher'
|
||||
import { processActorKeys } from './handlers/actor-keys'
|
||||
import { processEmail } from './handlers/email'
|
||||
import { processMoveToObjectStorage } from './handlers/move-to-object-storage'
|
||||
import { processVideoFileImport } from './handlers/video-file-import'
|
||||
import { processVideoImport } from './handlers/video-import'
|
||||
import { processVideoLiveEnding } from './handlers/video-live-ending'
|
||||
import { processVideoTranscoding } from './handlers/video-transcoding'
|
||||
import { processVideosViews } from './handlers/video-views'
|
||||
import { processMoveToObjectStorage } from './handlers/move-to-object-storage'
|
||||
|
||||
type CreateJobArgument =
|
||||
{ type: 'activitypub-http-broadcast', payload: ActivitypubHttpBroadcastPayload } |
|
||||
|
@ -59,7 +59,7 @@ export type CreateJobOptions = {
|
|||
priority?: number
|
||||
}
|
||||
|
||||
const handlers: { [id in JobType]: (job: Bull.Job) => Promise<any> } = {
|
||||
const handlers: { [id in JobType]: (job: Job) => Promise<any> } = {
|
||||
'activitypub-http-broadcast': processActivityPubHttpBroadcast,
|
||||
'activitypub-http-unicast': processActivityPubHttpUnicast,
|
||||
'activitypub-http-fetcher': processActivityPubHttpFetcher,
|
||||
|
@ -99,7 +99,7 @@ class JobQueue {
|
|||
|
||||
private static instance: JobQueue
|
||||
|
||||
private queues: { [id in JobType]?: Bull.Queue } = {}
|
||||
private queues: { [id in JobType]?: Queue } = {}
|
||||
private initialized = false
|
||||
private jobRedisPrefix: string
|
||||
|
||||
|
@ -160,7 +160,7 @@ class JobQueue {
|
|||
return
|
||||
}
|
||||
|
||||
const jobArgs: Bull.JobOptions = {
|
||||
const jobArgs: JobOptions = {
|
||||
backoff: { delay: 60 * 1000, type: 'exponential' },
|
||||
attempts: JOB_ATTEMPTS[obj.type],
|
||||
timeout: JOB_TTL[obj.type],
|
||||
|
@ -177,11 +177,11 @@ class JobQueue {
|
|||
count: number
|
||||
asc?: boolean
|
||||
jobType: JobType
|
||||
}): Promise<Bull.Job[]> {
|
||||
}): Promise<Job[]> {
|
||||
const { state, start, count, asc, jobType } = options
|
||||
|
||||
const states = state ? [ state ] : jobStates
|
||||
let results: Bull.Job[] = []
|
||||
let results: Job[] = []
|
||||
|
||||
const filteredJobTypes = this.filterJobTypes(jobType)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue