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:
parent
6bcb854cde
commit
0c9668f779
168 changed files with 6907 additions and 2803 deletions
18
server/lib/transcoding/ended-transcoding.ts
Normal file
18
server/lib/transcoding/ended-transcoding.ts
Normal 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 })
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue