aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/peertube-runner/server/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/peertube-runner/server/server.ts')
-rw-r--r--packages/peertube-runner/server/server.ts7
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'
8import { IPCServer } from '../shared/ipc' 8import { IPCServer } from '../shared/ipc'
9import { logger } from '../shared/logger' 9import { logger } from '../shared/logger'
10import { JobWithToken, processJob } from './process' 10import { JobWithToken, processJob } from './process'
11import { isJobSupported } from './shared'
11 12
12type PeerTubeServer = PeerTubeServerCommand & { 13type 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 }) {