diff options
author | Chocobozzz <me@florianbigard.com> | 2019-01-08 11:26:41 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-01-09 11:15:15 +0100 |
commit | 2f1548fda32c3ba9e53913270394eedfacd55986 (patch) | |
tree | afee28df36a9e00f921603d9091e5d08d5818159 /shared/utils/server/jobs.ts | |
parent | f7cc67b455a12ccae9b0ea16876d166720364357 (diff) | |
download | PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.gz PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.zst PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.zip |
Add notifications in the client
Diffstat (limited to 'shared/utils/server/jobs.ts')
-rw-r--r-- | shared/utils/server/jobs.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/shared/utils/server/jobs.ts b/shared/utils/server/jobs.ts index 6218c0b66..692b5e24d 100644 --- a/shared/utils/server/jobs.ts +++ b/shared/utils/server/jobs.ts | |||
@@ -29,6 +29,7 @@ function getJobsListPaginationAndSort (url: string, accessToken: string, state: | |||
29 | } | 29 | } |
30 | 30 | ||
31 | async function waitJobs (serversArg: ServerInfo[] | ServerInfo) { | 31 | async function waitJobs (serversArg: ServerInfo[] | ServerInfo) { |
32 | const pendingJobWait = process.env.NODE_PENDING_JOB_WAIT ? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10) : 2000 | ||
32 | let servers: ServerInfo[] | 33 | let servers: ServerInfo[] |
33 | 34 | ||
34 | if (Array.isArray(serversArg) === false) servers = [ serversArg as ServerInfo ] | 35 | if (Array.isArray(serversArg) === false) servers = [ serversArg as ServerInfo ] |
@@ -62,7 +63,7 @@ async function waitJobs (serversArg: ServerInfo[] | ServerInfo) { | |||
62 | 63 | ||
63 | // Retry, in case of new jobs were created | 64 | // Retry, in case of new jobs were created |
64 | if (pendingRequests === false) { | 65 | if (pendingRequests === false) { |
65 | await wait(2000) | 66 | await wait(pendingJobWait) |
66 | await Promise.all(tasksBuilder()) | 67 | await Promise.all(tasksBuilder()) |
67 | } | 68 | } |
68 | 69 | ||