aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/job-queue.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-19 14:23:00 +0100
committerChocobozzz <me@florianbigard.com>2022-01-19 14:31:05 +0100
commit419b520ca4434d17f3505013174e195c3a316716 (patch)
tree24dbf663c4e11e970cb780f96e6eb3efe023b222 /server/lib/job-queue/job-queue.ts
parent52435e467a0b30175a10af1dd3ae10d7d564d8ae (diff)
downloadPeerTube-419b520ca4434d17f3505013174e195c3a316716.tar.gz
PeerTube-419b520ca4434d17f3505013174e195c3a316716.tar.zst
PeerTube-419b520ca4434d17f3505013174e195c3a316716.zip
Add ability to cancel & delete video imports
Diffstat (limited to 'server/lib/job-queue/job-queue.ts')
-rw-r--r--server/lib/job-queue/job-queue.ts12
1 files changed, 12 insertions, 0 deletions
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 {
162 } 162 }
163 } 163 }
164 164
165 async pause () {
166 for (const handler of Object.keys(this.queues)) {
167 await this.queues[handler].pause(true)
168 }
169 }
170
171 async resume () {
172 for (const handler of Object.keys(this.queues)) {
173 await this.queues[handler].resume(true)
174 }
175 }
176
165 createJob (obj: CreateJobArgument, options: CreateJobOptions = {}): void { 177 createJob (obj: CreateJobArgument, options: CreateJobOptions = {}): void {
166 this.createJobWithPromise(obj, options) 178 this.createJobWithPromise(obj, options)
167 .catch(err => logger.error('Cannot create job.', { err, obj })) 179 .catch(err => logger.error('Cannot create job.', { err, obj }))