1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Implement remote runner jobs in server

Move ffmpeg functions to @shared
This commit is contained in:
Chocobozzz 2023-04-21 14:55:10 +02:00 committed by Chocobozzz
parent 6bcb854cde
commit 0c9668f779
168 changed files with 6907 additions and 2803 deletions

View file

@ -0,0 +1,18 @@
import { retryTransactionWrapper } from '@server/helpers/database-utils'
import { VideoJobInfoModel } from '@server/models/video/video-job-info'
import { MVideo } from '@server/types/models'
import { moveToNextState } from '../video-state'
export async function onTranscodingEnded (options: {
video: MVideo
isNewVideo: boolean
moveVideoToNextState: boolean
}) {
const { video, isNewVideo, moveVideoToNextState } = options
await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode')
if (moveVideoToNextState) {
await retryTransactionWrapper(moveToNextState, { video, isNewVideo })
}
}