import { throttle } from 'lodash'
-import { retryTransactionWrapper, saveInTransactionWithRetries } from '@server/helpers/database-utils'
+import { saveInTransactionWithRetries } from '@server/helpers/database-utils'
import { logger, loggerTagsFactory } from '@server/helpers/logger'
import { RUNNER_JOBS } from '@server/initializers/constants'
import { sequelizeTypescript } from '@server/initializers/database'
return
}
- await retryTransactionWrapper(() => {
- return sequelizeTypescript.transaction(async transaction => {
- return runnerJob.save({ transaction })
- })
- })
+ await saveInTransactionWithRetries(runnerJob)
}
// ---------------------------------------------------------------------------
runnerJob.setToErrorOrCancel(cancelState)
- await retryTransactionWrapper(() => {
- return sequelizeTypescript.transaction(async transaction => {
- await runnerJob.save({ transaction })
- })
- })
+ await saveInTransactionWithRetries(runnerJob)
const children = await RunnerJobModel.listChildrenOf(runnerJob)
for (const child of children) {
runnerJob.resetToPending()
- await retryTransactionWrapper(() => {
- return sequelizeTypescript.transaction(async transaction => {
- await runnerJob.save({ transaction })
- })
- })
+ await saveInTransactionWithRetries(runnerJob)
}
protected setAbortState (runnerJob: MRunnerJob) {
runnerJob.resetToPending()
}
- await retryTransactionWrapper(() => {
- return sequelizeTypescript.transaction(async transaction => {
- await runnerJob.save({ transaction })
- })
- })
+ await saveInTransactionWithRetries(runnerJob)
if (runnerJob.state === errorState) {
const children = await RunnerJobModel.listChildrenOf(runnerJob)