Fix stuck runner

pull/6318/head
Chocobozzz 2024-04-04 16:31:01 +02:00
parent d1e634acff
commit 93b09bf891
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 2 deletions

View File

@ -200,18 +200,20 @@ export class RunnerServer {
await this.tryToExecuteJobAsync(server, job) await this.tryToExecuteJobAsync(server, job)
} catch (err) { } catch (err) {
hadAvailableJob = false
const code = (err.res?.body as PeerTubeProblemDocument)?.code const code = (err.res?.body as PeerTubeProblemDocument)?.code
if (code === ServerErrorCode.RUNNER_JOB_NOT_IN_PENDING_STATE) { if (code === ServerErrorCode.RUNNER_JOB_NOT_IN_PENDING_STATE) {
logger.debug({ err }, 'Runner job is not in pending state anymore, retry later') logger.debug({ err }, 'Runner job is not in pending state anymore, retry later')
return continue
} }
if (code === ServerErrorCode.UNKNOWN_RUNNER_TOKEN) { if (code === ServerErrorCode.UNKNOWN_RUNNER_TOKEN) {
logger.error({ err }, `Unregistering ${server.url} as the runner token ${server.runnerToken} is invalid`) logger.error({ err }, `Unregistering ${server.url} as the runner token ${server.runnerToken} is invalid`)
await this.unregisterRunner({ url: server.url, runnerName: server.runnerName }) await this.unregisterRunner({ url: server.url, runnerName: server.runnerName })
return continue
} }
logger.error({ err }, `Cannot request/accept job on ${server.url} for runner ${server.runnerName}`) logger.error({ err }, `Cannot request/accept job on ${server.url} for runner ${server.runnerName}`)