Don't cancel finished jobs

pull/6288/head
Chocobozzz 2024-03-19 08:37:50 +01:00
parent c727a34cb6
commit 0301d77254
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 6 additions and 3 deletions

View File

@ -523,7 +523,7 @@ class LiveManager {
}
private async handleBrokenLives () {
await RunnerJobModel.cancelAllJobs({ type: 'live-rtmp-hls-transcoding' })
await RunnerJobModel.cancelAllNonFinishedJobs({ type: 'live-rtmp-hls-transcoding' })
const videoUUIDs = await VideoModel.listPublishedLiveUUIDs()

View File

@ -278,9 +278,12 @@ export class RunnerJobModel extends SequelizeModel<RunnerJobModel> {
return RunnerJobModel.update({ state: RunnerJobState.PENDING }, { where })
}
static cancelAllJobs (options: { type: RunnerJobType }) {
static cancelAllNonFinishedJobs (options: { type: RunnerJobType }) {
const where = {
type: options.type
type: options.type,
state: {
[Op.in]: [ RunnerJobState.COMPLETING, RunnerJobState.PENDING, RunnerJobState.PROCESSING, RunnerJobState.WAITING_FOR_PARENT_JOB ]
}
}
return RunnerJobModel.update({ state: RunnerJobState.CANCELLED }, { where })