]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/job-queue.ts
Add ability to cancel & delete video imports
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / job-queue.ts
index fbc599f127a865d8b41773e0e0b9935628574b7d..22bd1f5d2c70b3d8a8228aef440f4c70d7f7d552 100644 (file)
@@ -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 }))