aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-07 14:48:39 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-05-07 15:42:23 +0200
commit4b91bc1525e89643c575cac6557c86f64e657aa2 (patch)
tree95fb52c26a18bd44c183aa5cf801ea34fc51a336
parentd15aebf511f92d19d3ef9b196e54525ec6c3a4cd (diff)
downloadPeerTube-4b91bc1525e89643c575cac6557c86f64e657aa2.tar.gz
PeerTube-4b91bc1525e89643c575cac6557c86f64e657aa2.tar.zst
PeerTube-4b91bc1525e89643c575cac6557c86f64e657aa2.zip
Reduce pending job waiting
-rw-r--r--.github/workflows/test.yml2
-rw-r--r--shared/extra-utils/server/jobs.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 442317ce2..a1edde1ef 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -44,7 +44,7 @@ jobs:
44 env: 44 env:
45 PGUSER: peertube 45 PGUSER: peertube
46 PGHOST: localhost 46 PGHOST: localhost
47 NODE_PENDING_JOB_WAIT: 500 47 NODE_PENDING_JOB_WAIT: 250
48 48
49 steps: 49 steps:
50 - uses: actions/checkout@v2 50 - uses: actions/checkout@v2
diff --git a/shared/extra-utils/server/jobs.ts b/shared/extra-utils/server/jobs.ts
index 704929bd4..763374e03 100644
--- a/shared/extra-utils/server/jobs.ts
+++ b/shared/extra-utils/server/jobs.ts
@@ -55,7 +55,7 @@ function getJobsListPaginationAndSort (options: {
55async function waitJobs (serversArg: ServerInfo[] | ServerInfo) { 55async function waitJobs (serversArg: ServerInfo[] | ServerInfo) {
56 const pendingJobWait = process.env.NODE_PENDING_JOB_WAIT 56 const pendingJobWait = process.env.NODE_PENDING_JOB_WAIT
57 ? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10) 57 ? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10)
58 : 500 58 : 250
59 59
60 let servers: ServerInfo[] 60 let servers: ServerInfo[]
61 61
@@ -115,7 +115,7 @@ async function waitJobs (serversArg: ServerInfo[] | ServerInfo) {
115 } 115 }
116 116
117 if (pendingRequests) { 117 if (pendingRequests) {
118 await wait(1000) 118 await wait(pendingJobWait)
119 } 119 }
120 } while (pendingRequests) 120 } while (pendingRequests)
121} 121}