mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Don't cancel finished jobs
This commit is contained in:
parent
c727a34cb6
commit
0301d77254
@ -523,7 +523,7 @@ class LiveManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async handleBrokenLives () {
|
private async handleBrokenLives () {
|
||||||
await RunnerJobModel.cancelAllJobs({ type: 'live-rtmp-hls-transcoding' })
|
await RunnerJobModel.cancelAllNonFinishedJobs({ type: 'live-rtmp-hls-transcoding' })
|
||||||
|
|
||||||
const videoUUIDs = await VideoModel.listPublishedLiveUUIDs()
|
const videoUUIDs = await VideoModel.listPublishedLiveUUIDs()
|
||||||
|
|
||||||
|
@ -278,9 +278,12 @@ export class RunnerJobModel extends SequelizeModel<RunnerJobModel> {
|
|||||||
return RunnerJobModel.update({ state: RunnerJobState.PENDING }, { where })
|
return RunnerJobModel.update({ state: RunnerJobState.PENDING }, { where })
|
||||||
}
|
}
|
||||||
|
|
||||||
static cancelAllJobs (options: { type: RunnerJobType }) {
|
static cancelAllNonFinishedJobs (options: { type: RunnerJobType }) {
|
||||||
const where = {
|
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 })
|
return RunnerJobModel.update({ state: RunnerJobState.CANCELLED }, { where })
|
||||||
|
Loading…
Reference in New Issue
Block a user