Fix cancel on stall error message

This commit is contained in:
Chocobozzz 2024-03-19 08:39:41 +01:00
parent 0301d77254
commit 0e718cb7b2
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 8 additions and 3 deletions

View File

@ -199,11 +199,12 @@ export abstract class AbstractJobHandler <C, U extends RunnerJobUpdatePayload, S
async abort (options: {
runnerJob: MRunnerJob
abortNotSupportedErrorMessage?: string
}) {
const { runnerJob } = options
const { runnerJob, abortNotSupportedErrorMessage = 'Job has been aborted but it is not supported by this job type' } = options
if (this.isAbortSupported() !== true) {
return this.error({ runnerJob, message: 'Job has been aborted but it is not supported by this job type' })
return this.error({ runnerJob, message: abortNotSupportedErrorMessage })
}
await this.specificAbort(options)

View File

@ -32,7 +32,11 @@ export class RunnerJobWatchDogScheduler extends AbstractScheduler {
logger.info('Abort stalled runner job %s (%s)', stalled.uuid, stalled.type, lTags(stalled.uuid, stalled.type))
const Handler = getRunnerJobHandlerClass(stalled)
await new Handler().abort({ runnerJob: stalled })
await new Handler().abort({
runnerJob: stalled,
abortNotSupportedErrorMessage: 'Stalled runner job'
})
}
}