mirror of https://github.com/Chocobozzz/PeerTube
				
				
				
			Don't cancel finished jobs
							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