From 419b520ca4434d17f3505013174e195c3a316716 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Jan 2022 14:23:00 +0100 Subject: Add ability to cancel & delete video imports --- server/lib/job-queue/job-queue.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'server/lib/job-queue/job-queue.ts') diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index fbc599f12..22bd1f5d2 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts @@ -162,6 +162,18 @@ class JobQueue { } } + async pause () { + for (const handler of Object.keys(this.queues)) { + await this.queues[handler].pause(true) + } + } + + async resume () { + for (const handler of Object.keys(this.queues)) { + await this.queues[handler].resume(true) + } + } + createJob (obj: CreateJobArgument, options: CreateJobOptions = {}): void { this.createJobWithPromise(obj, options) .catch(err => logger.error('Cannot create job.', { err, obj })) -- cgit v1.2.3