@jonit-dev/night-watch-cli 1.8.4-beta.5 → 1.8.4-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +29 -1
- package/dist/web/assets/index-DnHkqbOa.js +386 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -492,7 +492,7 @@ If no issues are warranted, output an empty array: []`;
|
|
|
492
492
|
GLOBAL_NOTIFICATIONS_FILE_NAME = "global-notifications.json";
|
|
493
493
|
MAX_HISTORY_RECORDS_PER_PRD = 10;
|
|
494
494
|
DEFAULT_QUEUE_ENABLED = true;
|
|
495
|
-
DEFAULT_QUEUE_MODE = "
|
|
495
|
+
DEFAULT_QUEUE_MODE = "auto";
|
|
496
496
|
DEFAULT_QUEUE_MAX_CONCURRENCY = 1;
|
|
497
497
|
DEFAULT_QUEUE_MAX_WAIT_TIME = 7200;
|
|
498
498
|
DEFAULT_QUEUE_PRIORITY = getDefaultQueuePriority();
|
|
@@ -6615,6 +6615,34 @@ function dispatchNextJob(config) {
|
|
|
6615
6615
|
});
|
|
6616
6616
|
return { ...entry, status: "dispatched", dispatchedAt: now };
|
|
6617
6617
|
}
|
|
6618
|
+
if (mode === "auto") {
|
|
6619
|
+
const candidates2 = getPendingCandidates(db);
|
|
6620
|
+
if (candidates2.length === 0) {
|
|
6621
|
+
logger.debug("Dispatch skipped: no pending jobs");
|
|
6622
|
+
return null;
|
|
6623
|
+
}
|
|
6624
|
+
logger.debug("Auto dispatch: evaluating candidates", { candidateCount: candidates2.length });
|
|
6625
|
+
const inFlightByBucket2 = getInFlightCountByBucket(db);
|
|
6626
|
+
for (const candidate of candidates2) {
|
|
6627
|
+
const bucketKey = candidate.providerKey ?? "default";
|
|
6628
|
+
if ((inFlightByBucket2[bucketKey] ?? 0) === 0) {
|
|
6629
|
+
db.prepare(`UPDATE job_queue SET status = 'dispatched', dispatched_at = ? WHERE id = ?`).run(now, candidate.id);
|
|
6630
|
+
logger.info("Job dispatched (auto)", {
|
|
6631
|
+
id: candidate.id,
|
|
6632
|
+
jobType: candidate.jobType,
|
|
6633
|
+
project: candidate.projectName,
|
|
6634
|
+
priority: candidate.priority,
|
|
6635
|
+
providerKey: candidate.providerKey ?? null,
|
|
6636
|
+
waitSeconds: now - candidate.enqueuedAt
|
|
6637
|
+
});
|
|
6638
|
+
return { ...candidate, status: "dispatched", dispatchedAt: now };
|
|
6639
|
+
}
|
|
6640
|
+
}
|
|
6641
|
+
logger.info("Dispatch skipped: all candidates blocked by provider concurrency (auto)", {
|
|
6642
|
+
candidateCount: candidates2.length
|
|
6643
|
+
});
|
|
6644
|
+
return null;
|
|
6645
|
+
}
|
|
6618
6646
|
const candidates = getPendingCandidates(db);
|
|
6619
6647
|
if (candidates.length === 0) {
|
|
6620
6648
|
logger.debug("Dispatch skipped: no pending jobs");
|