]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/server/jobs.ts
Reduce pending job waiting
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / server / jobs.ts
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)
 }