Retry runner job db saving if needed

pull/6048/head
Chocobozzz 2023-11-24 14:44:04 +01:00
parent 6349881dbd
commit f93bc6a8be
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 4 deletions

View File

@ -86,15 +86,13 @@ export abstract class AbstractJobHandler <C, U extends RunnerJobUpdatePayload, S
priority priority
}) })
const job = await sequelizeTypescript.transaction(async transaction => { await saveInTransactionWithRetries(runnerJob)
return runnerJob.save({ transaction })
})
if (runnerJob.state === RunnerJobState.PENDING) { if (runnerJob.state === RunnerJobState.PENDING) {
PeerTubeSocket.Instance.sendAvailableJobsPingToRunners() PeerTubeSocket.Instance.sendAvailableJobsPingToRunners()
} }
return job return runnerJob
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------