diff options
author | Chocobozzz <me@florianbigard.com> | 2023-06-01 14:51:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-06-29 10:16:55 +0200 |
commit | d8f39b126d9fe4bec1c12fb213548cc6edc87867 (patch) | |
tree | 7f0f1cb23165cf4dd789b2d78b1fef7ee116f647 /shared/server-commands/server/jobs.ts | |
parent | 1fb7d094229acdc190c3f7551b43ac5445814dee (diff) | |
download | PeerTube-d8f39b126d9fe4bec1c12fb213548cc6edc87867.tar.gz PeerTube-d8f39b126d9fe4bec1c12fb213548cc6edc87867.tar.zst PeerTube-d8f39b126d9fe4bec1c12fb213548cc6edc87867.zip |
Add storyboard support
Diffstat (limited to 'shared/server-commands/server/jobs.ts')
-rw-r--r-- | shared/server-commands/server/jobs.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/shared/server-commands/server/jobs.ts b/shared/server-commands/server/jobs.ts index ff3098063..8f131fba4 100644 --- a/shared/server-commands/server/jobs.ts +++ b/shared/server-commands/server/jobs.ts | |||
@@ -33,6 +33,8 @@ async function waitJobs ( | |||
33 | 33 | ||
34 | // Check if each server has pending request | 34 | // Check if each server has pending request |
35 | for (const server of servers) { | 35 | for (const server of servers) { |
36 | if (process.env.DEBUG) console.log('Checking ' + server.url) | ||
37 | |||
36 | for (const state of states) { | 38 | for (const state of states) { |
37 | 39 | ||
38 | const jobPromise = server.jobs.list({ | 40 | const jobPromise = server.jobs.list({ |
@@ -45,6 +47,10 @@ async function waitJobs ( | |||
45 | .then(jobs => { | 47 | .then(jobs => { |
46 | if (jobs.length !== 0) { | 48 | if (jobs.length !== 0) { |
47 | pendingRequests = true | 49 | pendingRequests = true |
50 | |||
51 | if (process.env.DEBUG) { | ||
52 | console.log(jobs) | ||
53 | } | ||
48 | } | 54 | } |
49 | }) | 55 | }) |
50 | 56 | ||
@@ -55,6 +61,10 @@ async function waitJobs ( | |||
55 | .then(obj => { | 61 | .then(obj => { |
56 | if (obj.activityPubMessagesWaiting !== 0) { | 62 | if (obj.activityPubMessagesWaiting !== 0) { |
57 | pendingRequests = true | 63 | pendingRequests = true |
64 | |||
65 | if (process.env.DEBUG) { | ||
66 | console.log('AP messages waiting: ' + obj.activityPubMessagesWaiting) | ||
67 | } | ||
58 | } | 68 | } |
59 | }) | 69 | }) |
60 | tasks.push(debugPromise) | 70 | tasks.push(debugPromise) |
@@ -65,12 +75,15 @@ async function waitJobs ( | |||
65 | for (const job of data) { | 75 | for (const job of data) { |
66 | if (job.state.id !== RunnerJobState.COMPLETED) { | 76 | if (job.state.id !== RunnerJobState.COMPLETED) { |
67 | pendingRequests = true | 77 | pendingRequests = true |
78 | |||
79 | if (process.env.DEBUG) { | ||
80 | console.log(job) | ||
81 | } | ||
68 | } | 82 | } |
69 | } | 83 | } |
70 | }) | 84 | }) |
71 | tasks.push(runnerJobsPromise) | 85 | tasks.push(runnerJobsPromise) |
72 | } | 86 | } |
73 | |||
74 | } | 87 | } |
75 | 88 | ||
76 | return tasks | 89 | return tasks |