]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Reduce pending job waiting
authorChocobozzz <me@florianbigard.com>
Fri, 7 May 2021 12:48:39 +0000 (14:48 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Fri, 7 May 2021 13:42:23 +0000 (15:42 +0200)
.github/workflows/test.yml
shared/extra-utils/server/jobs.ts

index 442317ce2bfcf12f0320b35a112a9cd5781705f6..a1edde1ef00045298e0b22fd1ae773620eb031e2 100644 (file)
@@ -44,7 +44,7 @@ jobs:
     env:
       PGUSER: peertube
       PGHOST: localhost
-      NODE_PENDING_JOB_WAIT: 500
+      NODE_PENDING_JOB_WAIT: 250
 
     steps:
       - uses: actions/checkout@v2
index 704929bd4f499560f7d7eacdff60a10f214ff434..763374e030e39323a0ef8983ebc437f57c186bfb 100644 (file)
@@ -55,7 +55,7 @@ function getJobsListPaginationAndSort (options: {
 async function waitJobs (serversArg: ServerInfo[] | ServerInfo) {
   const pendingJobWait = process.env.NODE_PENDING_JOB_WAIT
     ? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10)
-    : 500
+    : 250
 
   let servers: ServerInfo[]
 
@@ -115,7 +115,7 @@ async function waitJobs (serversArg: ServerInfo[] | ServerInfo) {
     }
 
     if (pendingRequests) {
-      await wait(1000)
+      await wait(pendingJobWait)
     }
   } while (pendingRequests)
 }