mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 07:37:08 +00:00
Compare commits
3 Commits
v2023.39.1
...
136-add-li
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b6b81dbc5 | ||
|
|
2e11c574c2 | ||
|
|
d07565807c |
@@ -35,7 +35,7 @@ class ReportLineChangeTime {
|
||||
while (this.queue.length > 0) {
|
||||
if (this.queue[0].isPending) {
|
||||
DEBUG("Queue busy");
|
||||
setImmediate(() => this.processQueue());
|
||||
setTimeout(() => this.processQueue(), 1000); // We're not in a hurry
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class ReportLineChangeTime {
|
||||
const forward = (cur.old?.labels?.includes("LGSP") || cur.new?.labels?.includes("LGSP"));
|
||||
|
||||
if (!projectId) {
|
||||
WARNING("No projectID found in event", cur);
|
||||
throw {message: "No projectID found in event", cur};
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -267,6 +267,7 @@ class ReportLineChangeTime {
|
||||
}
|
||||
|
||||
async run (data) {
|
||||
DEBUG("Seen", data);
|
||||
if (!data || data.channel !== "event") {
|
||||
return;
|
||||
}
|
||||
@@ -285,10 +286,12 @@ class ReportLineChangeTime {
|
||||
|
||||
if (this.queue.length < ReportLineChangeTime.MAX_QUEUE_SIZE) {
|
||||
|
||||
this.queue.push({
|
||||
...data.payload,
|
||||
const item = {
|
||||
...structuredClone(data.payload),
|
||||
isPending: this.queue.length,
|
||||
});
|
||||
};
|
||||
DEBUG("Queueing", item);
|
||||
this.queue.push(item);
|
||||
|
||||
} else {
|
||||
ALERT("ReportLineChangeTime queue full at", this.queue.length);
|
||||
|
||||
Reference in New Issue
Block a user