]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/server-commands/runners/runner-jobs-command.ts
Support studio transcoding in peertube runner
[github/Chocobozzz/PeerTube.git] / shared / server-commands / runners / runner-jobs-command.ts
index 3b0f84b9d353c114d5d576526b44d025d9efa0a0..26dbef77ae0982a18d19a765308db459d25cfdc3 100644 (file)
@@ -200,7 +200,7 @@ export class RunnerJobsCommand extends AbstractCommand {
     })
   }
 
-  getInputFile (options: OverrideCommandOptions & { url: string, jobToken: string, runnerToken: string }) {
+  getJobFile (options: OverrideCommandOptions & { url: string, jobToken: string, runnerToken: string }) {
     const { host, protocol, pathname } = new URL(options.url)
 
     return this.postBodyRequest({
@@ -249,8 +249,15 @@ export class RunnerJobsCommand extends AbstractCommand {
 
     const { data } = await this.list({ count: 100 })
 
+    const allowedStates = new Set<RunnerJobState>([
+      RunnerJobState.PENDING,
+      RunnerJobState.PROCESSING,
+      RunnerJobState.WAITING_FOR_PARENT_JOB
+    ])
+
     for (const job of data) {
       if (state && job.state.id !== state) continue
+      else if (allowedStates.has(job.state.id) !== true) continue
 
       await this.cancelByAdmin({ jobUUID: job.uuid })
     }