aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/peertube-runner/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-19 10:16:43 +0200
committerChocobozzz <me@florianbigard.com>2023-05-19 10:16:43 +0200
commit296d07c6fe55120492aef9cfe8fe5aeb9065a11d (patch)
tree562648f4f94a6978c4a7b36b7854b94ce596955e /packages/peertube-runner/server
parent472170b4f923a52cceb595221864eab61d624d5b (diff)
downloadPeerTube-296d07c6fe55120492aef9cfe8fe5aeb9065a11d.tar.gz
PeerTube-296d07c6fe55120492aef9cfe8fe5aeb9065a11d.tar.zst
PeerTube-296d07c6fe55120492aef9cfe8fe5aeb9065a11d.zip
Prefer to wait before processing new jobs
Diffstat (limited to 'packages/peertube-runner/server')
-rw-r--r--packages/peertube-runner/server/server.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/peertube-runner/server/server.ts b/packages/peertube-runner/server/server.ts
index cb1533dc6..087405dfe 100644
--- a/packages/peertube-runner/server/server.ts
+++ b/packages/peertube-runner/server/server.ts
@@ -1,7 +1,7 @@
1import { ensureDir, readdir, remove } from 'fs-extra' 1import { ensureDir, readdir, remove } from 'fs-extra'
2import { join } from 'path' 2import { join } from 'path'
3import { io, Socket } from 'socket.io-client' 3import { io, Socket } from 'socket.io-client'
4import { pick } from '@shared/core-utils' 4import { pick, wait } from '@shared/core-utils'
5import { PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' 5import { PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'
6import { PeerTubeServer as PeerTubeServerCommand } from '@shared/server-commands' 6import { PeerTubeServer as PeerTubeServerCommand } from '@shared/server-commands'
7import { ConfigManager } from '../shared' 7import { ConfigManager } from '../shared'
@@ -206,6 +206,8 @@ export class RunnerServer {
206 this.checkingAvailableJobs = false 206 this.checkingAvailableJobs = false
207 207
208 if (hadAvailableJob && this.canProcessMoreJobs()) { 208 if (hadAvailableJob && this.canProcessMoreJobs()) {
209 await wait(2500)
210
209 this.checkAvailableJobs() 211 this.checkAvailableJobs()
210 .catch(err => logger.error({ err }, 'Cannot check more available jobs')) 212 .catch(err => logger.error({ err }, 'Cannot check more available jobs'))
211 } 213 }