From 472170b4f923a52cceb595221864eab61d624d5b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 19 May 2023 10:10:41 +0200 Subject: Avoid aborting completing jobs --- server/lib/runners/job-handlers/abstract-job-handler.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'server/lib/runners') diff --git a/server/lib/runners/job-handlers/abstract-job-handler.ts b/server/lib/runners/job-handlers/abstract-job-handler.ts index 28c3e1eda..ca97d0881 100644 --- a/server/lib/runners/job-handlers/abstract-job-handler.ts +++ b/server/lib/runners/job-handlers/abstract-job-handler.ts @@ -1,5 +1,5 @@ import { throttle } from 'lodash' -import { retryTransactionWrapper } from '@server/helpers/database-utils' +import { retryTransactionWrapper, 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' @@ -12,10 +12,10 @@ import { RunnerJobLiveRTMPHLSTranscodingPayload, RunnerJobLiveRTMPHLSTranscodingPrivatePayload, RunnerJobState, + RunnerJobStudioTranscodingPayload, RunnerJobSuccessPayload, RunnerJobType, RunnerJobUpdatePayload, - RunnerJobStudioTranscodingPayload, RunnerJobVideoStudioTranscodingPrivatePayload, RunnerJobVODAudioMergeTranscodingPayload, RunnerJobVODAudioMergeTranscodingPrivatePayload, @@ -139,6 +139,9 @@ export abstract class AbstractJobHandler { - return sequelizeTypescript.transaction(async transaction => { - await runnerJob.save({ transaction }) - }) - }) + await saveInTransactionWithRetries(runnerJob) const [ affectedCount ] = await RunnerJobModel.updateDependantJobsOf(runnerJob) -- cgit v1.2.3