aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/runners/runner-jobs-command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands/runners/runner-jobs-command.ts')
-rw-r--r--shared/server-commands/runners/runner-jobs-command.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/shared/server-commands/runners/runner-jobs-command.ts b/shared/server-commands/runners/runner-jobs-command.ts
index 3b0f84b9d..26dbef77a 100644
--- a/shared/server-commands/runners/runner-jobs-command.ts
+++ b/shared/server-commands/runners/runner-jobs-command.ts
@@ -200,7 +200,7 @@ export class RunnerJobsCommand extends AbstractCommand {
200 }) 200 })
201 } 201 }
202 202
203 getInputFile (options: OverrideCommandOptions & { url: string, jobToken: string, runnerToken: string }) { 203 getJobFile (options: OverrideCommandOptions & { url: string, jobToken: string, runnerToken: string }) {
204 const { host, protocol, pathname } = new URL(options.url) 204 const { host, protocol, pathname } = new URL(options.url)
205 205
206 return this.postBodyRequest({ 206 return this.postBodyRequest({
@@ -249,8 +249,15 @@ export class RunnerJobsCommand extends AbstractCommand {
249 249
250 const { data } = await this.list({ count: 100 }) 250 const { data } = await this.list({ count: 100 })
251 251
252 const allowedStates = new Set<RunnerJobState>([
253 RunnerJobState.PENDING,
254 RunnerJobState.PROCESSING,
255 RunnerJobState.WAITING_FOR_PARENT_JOB
256 ])
257
252 for (const job of data) { 258 for (const job of data) {
253 if (state && job.state.id !== state) continue 259 if (state && job.state.id !== state) continue
260 else if (allowedStates.has(job.state.id) !== true) continue
254 261
255 await this.cancelByAdmin({ jobUUID: job.uuid }) 262 await this.cancelByAdmin({ jobUUID: job.uuid })
256 } 263 }