diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-04 15:29:34 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 5e47f6ab984a7d00782e4c7030afffa1ba480add (patch) | |
tree | 1ce586b591a8d71acbc301eba29b9a5e6490439e /packages/peertube-runner/server/server.ts | |
parent | 6a4905602636afd6650c9e6f4d0fcc2105d91100 (diff) | |
download | PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.gz PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.zst PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.zip |
Support studio transcoding in peertube runner
Diffstat (limited to 'packages/peertube-runner/server/server.ts')
-rw-r--r-- | packages/peertube-runner/server/server.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/peertube-runner/server/server.ts b/packages/peertube-runner/server/server.ts index e851dfc7c..8eff4bd2f 100644 --- a/packages/peertube-runner/server/server.ts +++ b/packages/peertube-runner/server/server.ts | |||
@@ -8,6 +8,7 @@ import { ConfigManager } from '../shared' | |||
8 | import { IPCServer } from '../shared/ipc' | 8 | import { IPCServer } from '../shared/ipc' |
9 | import { logger } from '../shared/logger' | 9 | import { logger } from '../shared/logger' |
10 | import { JobWithToken, processJob } from './process' | 10 | import { JobWithToken, processJob } from './process' |
11 | import { isJobSupported } from './shared' | ||
11 | 12 | ||
12 | type PeerTubeServer = PeerTubeServerCommand & { | 13 | type PeerTubeServer = PeerTubeServerCommand & { |
13 | runnerToken: string | 14 | runnerToken: string |
@@ -199,12 +200,14 @@ export class RunnerServer { | |||
199 | 200 | ||
200 | const { availableJobs } = await server.runnerJobs.request({ runnerToken: server.runnerToken }) | 201 | const { availableJobs } = await server.runnerJobs.request({ runnerToken: server.runnerToken }) |
201 | 202 | ||
202 | if (availableJobs.length === 0) { | 203 | const filtered = availableJobs.filter(j => isJobSupported(j)) |
204 | |||
205 | if (filtered.length === 0) { | ||
203 | logger.debug(`No job available on ${server.url} for runner ${server.runnerName}`) | 206 | logger.debug(`No job available on ${server.url} for runner ${server.runnerName}`) |
204 | return undefined | 207 | return undefined |
205 | } | 208 | } |
206 | 209 | ||
207 | return availableJobs[0] | 210 | return filtered[0] |
208 | } | 211 | } |
209 | 212 | ||
210 | private async tryToExecuteJobAsync (server: PeerTubeServer, jobToAccept: { uuid: string }) { | 213 | private async tryToExecuteJobAsync (server: PeerTubeServer, jobToAccept: { uuid: string }) { |