mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-26 02:30:37 -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 () {
|
||||
await RunnerJobModel.cancelAllJobs({ type: 'live-rtmp-hls-transcoding' })
|
||||
await RunnerJobModel.cancelAllNonFinishedJobs({ type: 'live-rtmp-hls-transcoding' })
|
||||
|
||||
const videoUUIDs = await VideoModel.listPublishedLiveUUIDs()
|
||||
|
||||
|
@ -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 })
|
||||
|
Loading…
Reference in New Issue
Block a user