diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 14:55:10 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 0c9668f77901e7540e2c7045eb0f2974a4842a69 (patch) | |
tree | 226d3dd1565b0bb56588897af3b8530e6216e96b /server/lib/transcoding/ended-transcoding.ts | |
parent | 6bcb854cdea8688a32240bc5719c7d139806e00b (diff) | |
download | PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.gz PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.zst PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.zip |
Implement remote runner jobs in server
Move ffmpeg functions to @shared
Diffstat (limited to 'server/lib/transcoding/ended-transcoding.ts')
-rw-r--r-- | server/lib/transcoding/ended-transcoding.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/lib/transcoding/ended-transcoding.ts b/server/lib/transcoding/ended-transcoding.ts new file mode 100644 index 000000000..d31674ede --- /dev/null +++ b/server/lib/transcoding/ended-transcoding.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | ||
2 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' | ||
3 | import { MVideo } from '@server/types/models' | ||
4 | import { moveToNextState } from '../video-state' | ||
5 | |||
6 | export async function onTranscodingEnded (options: { | ||
7 | video: MVideo | ||
8 | isNewVideo: boolean | ||
9 | moveVideoToNextState: boolean | ||
10 | }) { | ||
11 | const { video, isNewVideo, moveVideoToNextState } = options | ||
12 | |||
13 | await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode') | ||
14 | |||
15 | if (moveVideoToNextState) { | ||
16 | await retryTransactionWrapper(moveToNextState, { video, isNewVideo }) | ||
17 | } | ||
18 | } | ||