@zintrust/queue-monitor 2.4.7 → 2.4.8
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/QueueMonitoringService.js +67 -54
- package/dist/dashboard-ui.js +107 -32
- package/dist/driver.js +2 -1
- package/package.json +1 -1
- package/dist/build-manifest.json +0 -129
|
@@ -6,6 +6,64 @@ const objectIds = new WeakMap();
|
|
|
6
6
|
let nextObjectId = 0;
|
|
7
7
|
const isAllQueuesSelection = (queue) => queue === ALL_QUEUES;
|
|
8
8
|
const sortJobsByTimestamp = (jobs) => jobs.toSorted((left, right) => right.timestamp - left.timestamp);
|
|
9
|
+
const jobIdentity = (job) => {
|
|
10
|
+
const queue = job.queue ?? '';
|
|
11
|
+
const id = job.id == null ? '' : String(job.id);
|
|
12
|
+
const timestamp = Number.isFinite(job.timestamp) ? String(job.timestamp) : '';
|
|
13
|
+
return `${queue}::${id}::${timestamp}`;
|
|
14
|
+
};
|
|
15
|
+
const dedupeJobs = (jobs) => {
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
return jobs.filter((job) => {
|
|
18
|
+
const identity = jobIdentity(job);
|
|
19
|
+
if (seen.has(identity))
|
|
20
|
+
return false;
|
|
21
|
+
seen.add(identity);
|
|
22
|
+
return true;
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const jobSummaryFromDriverJob = (queueName, job, now) => {
|
|
26
|
+
// Use the actual state from BullMQ if available.
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
const jobState = job._state;
|
|
29
|
+
const isFailed = Boolean(job.failedReason) || jobState === 'failed';
|
|
30
|
+
const isCompleted = Boolean(job.finishedOn) || jobState === 'completed';
|
|
31
|
+
const isActive = Boolean(job.processedOn && !job.finishedOn && !job.failedReason) || jobState === 'active';
|
|
32
|
+
const isDelayed = jobState === 'delayed';
|
|
33
|
+
const isPaused = jobState === 'paused';
|
|
34
|
+
let status;
|
|
35
|
+
if (isFailed) {
|
|
36
|
+
status = 'failed';
|
|
37
|
+
}
|
|
38
|
+
else if (isCompleted) {
|
|
39
|
+
status = 'completed';
|
|
40
|
+
}
|
|
41
|
+
else if (isActive) {
|
|
42
|
+
status = 'active';
|
|
43
|
+
}
|
|
44
|
+
else if (isDelayed) {
|
|
45
|
+
status = 'delayed';
|
|
46
|
+
}
|
|
47
|
+
else if (isPaused) {
|
|
48
|
+
status = 'paused';
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
status = 'waiting';
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
id: job.id,
|
|
55
|
+
name: job.name,
|
|
56
|
+
queue: queueName,
|
|
57
|
+
data: job.data,
|
|
58
|
+
opts: job.opts,
|
|
59
|
+
attempts: job.attemptsMade,
|
|
60
|
+
status,
|
|
61
|
+
failedReason: job.failedReason || undefined,
|
|
62
|
+
timestamp: job.timestamp ?? now,
|
|
63
|
+
processedOn: job.processedOn ?? undefined,
|
|
64
|
+
finishedOn: job.finishedOn ?? undefined,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
9
67
|
export const emptyLockAnalytics = () => ({
|
|
10
68
|
locks: [],
|
|
11
69
|
metrics: { active: 0, attempts: 0, acquired: 0, collisions: 0, collisionRate: 0 },
|
|
@@ -236,63 +294,18 @@ export const QueueMonitoringStream = (res, req, getSnapshot, getLocks, metrics,
|
|
|
236
294
|
});
|
|
237
295
|
};
|
|
238
296
|
export async function getRecentJobsForQueue(queueName, metrics, driver) {
|
|
239
|
-
const [recent, failed] = await Promise.all([
|
|
297
|
+
const [recent, failed, driverJobs] = await Promise.all([
|
|
240
298
|
metrics.getRecentJobs(queueName).catch(() => []),
|
|
241
299
|
metrics.getFailedJobs(queueName).catch(() => []),
|
|
300
|
+
driver.getRecentJobs(queueName, 100).catch((error) => {
|
|
301
|
+
Logger.warn('[queue-monitor] Driver recent jobs unavailable; returning no jobs', error);
|
|
302
|
+
return [];
|
|
303
|
+
}),
|
|
242
304
|
]);
|
|
243
|
-
const
|
|
305
|
+
const now = Date.now();
|
|
306
|
+
const liveJobs = driverJobs.map((job) => jobSummaryFromDriverJob(queueName, job, now));
|
|
307
|
+
return dedupeJobs(sortJobsByTimestamp([...recent, ...failed, ...liveJobs].map((job) => ({
|
|
244
308
|
...job,
|
|
245
309
|
queue: job.queue ?? queueName,
|
|
246
|
-
}))).slice(0, 100);
|
|
247
|
-
if (all.length > 0) {
|
|
248
|
-
return all;
|
|
249
|
-
}
|
|
250
|
-
const jobs = await driver.getRecentJobs(queueName, 100).catch((error) => {
|
|
251
|
-
Logger.warn('[queue-monitor] Driver recent jobs unavailable; returning no jobs', error);
|
|
252
|
-
return [];
|
|
253
|
-
});
|
|
254
|
-
const now = Date.now();
|
|
255
|
-
return jobs.map((job) => {
|
|
256
|
-
// Use the actual state from BullMQ if available
|
|
257
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
258
|
-
const jobState = job._state;
|
|
259
|
-
// Fallback detection if state is not available
|
|
260
|
-
const isFailed = Boolean(job.failedReason) || jobState === 'failed';
|
|
261
|
-
const isCompleted = Boolean(job.finishedOn) || jobState === 'completed';
|
|
262
|
-
const isActive = Boolean(job.processedOn && !job.finishedOn && !job.failedReason) || jobState === 'active';
|
|
263
|
-
const isDelayed = jobState === 'delayed';
|
|
264
|
-
const isPaused = jobState === 'paused';
|
|
265
|
-
let status;
|
|
266
|
-
if (isFailed) {
|
|
267
|
-
status = 'failed';
|
|
268
|
-
}
|
|
269
|
-
else if (isCompleted) {
|
|
270
|
-
status = 'completed';
|
|
271
|
-
}
|
|
272
|
-
else if (isActive) {
|
|
273
|
-
status = 'active';
|
|
274
|
-
}
|
|
275
|
-
else if (isDelayed) {
|
|
276
|
-
status = 'delayed';
|
|
277
|
-
}
|
|
278
|
-
else if (isPaused) {
|
|
279
|
-
status = 'paused';
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
status = 'waiting';
|
|
283
|
-
}
|
|
284
|
-
return {
|
|
285
|
-
id: job.id,
|
|
286
|
-
name: job.name,
|
|
287
|
-
queue: queueName,
|
|
288
|
-
data: job.data,
|
|
289
|
-
opts: job.opts,
|
|
290
|
-
attempts: job.attemptsMade,
|
|
291
|
-
status,
|
|
292
|
-
failedReason: job.failedReason || undefined,
|
|
293
|
-
timestamp: job.timestamp ?? now,
|
|
294
|
-
processedOn: job.processedOn ?? undefined,
|
|
295
|
-
finishedOn: job.finishedOn ?? undefined,
|
|
296
|
-
};
|
|
297
|
-
});
|
|
310
|
+
})))).slice(0, 100);
|
|
298
311
|
}
|
package/dist/dashboard-ui.js
CHANGED
|
@@ -115,6 +115,15 @@ html[data-theme="light"] .refresh-btn:hover { background: rgba(2, 132, 199, 0.16
|
|
|
115
115
|
.recover-btn { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); }
|
|
116
116
|
.recover-btn:hover { background: rgba(245, 158, 11, 0.2); }
|
|
117
117
|
|
|
118
|
+
.job-tab-bar { display: flex; gap: 0; padding: 0 8px; border-bottom: 1px solid var(--border); overflow-x: auto; }
|
|
119
|
+
.job-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 9px 12px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); transition: color 0.15s, border-color 0.15s; margin-bottom: -1px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
|
|
120
|
+
.job-tab:hover { color: var(--text); }
|
|
121
|
+
.job-tab.active-tab { color: var(--accent); border-bottom-color: var(--accent); }
|
|
122
|
+
.job-tab-count { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; min-width: 16px; text-align: center; }
|
|
123
|
+
.job-tab.active-tab .job-tab-count { background: rgba(186,230,253,0.12); }
|
|
124
|
+
html[data-theme="light"] .job-tab-count { background: rgba(0,0,0,0.06); }
|
|
125
|
+
html[data-theme="light"] .job-tab.active-tab .job-tab-count { background: rgba(2,132,199,0.12); }
|
|
126
|
+
|
|
118
127
|
#error-container { display: none; margin-bottom: 2rem; padding: 1rem; background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 0.5rem; font-size: 13px; font-weight: 600; }
|
|
119
128
|
code { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 12px; color: var(--accent); border: 1px solid var(--border); }
|
|
120
129
|
|
|
@@ -195,11 +204,21 @@ const getLocksSection = () => `
|
|
|
195
204
|
`;
|
|
196
205
|
const getJobsSection = () => `
|
|
197
206
|
<div class="tile" style="margin-top: 24px; padding: 0;">
|
|
198
|
-
<div style="padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
|
|
207
|
+
<div style="padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;">
|
|
199
208
|
<h3 style="margin: 0; font-size: 14px; font-weight: 800; color: var(--text);">Recent Jobs</h3>
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
209
|
+
<div style="display: flex; align-items: center; gap: 10px; flex-wrap: wrap;">
|
|
210
|
+
<button id="jobs-refresh" class="refresh-btn" type="button">Refresh jobs</button>
|
|
211
|
+
<select id="queue-select">
|
|
212
|
+
<!-- Queues inserted here -->
|
|
213
|
+
</select>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div class="job-tab-bar">
|
|
217
|
+
<button class="job-tab active-tab" data-status="all" type="button" onclick="setJobStatusFilter('all')">All <span class="job-tab-count" id="tab-count-all">—</span></button>
|
|
218
|
+
<button class="job-tab" data-status="active" type="button" onclick="setJobStatusFilter('active')">Active <span class="job-tab-count" id="tab-count-active">—</span></button>
|
|
219
|
+
<button class="job-tab" data-status="waiting" type="button" onclick="setJobStatusFilter('waiting')">Waiting <span class="job-tab-count" id="tab-count-waiting">—</span></button>
|
|
220
|
+
<button class="job-tab" data-status="failed" type="button" onclick="setJobStatusFilter('failed')">Failed <span class="job-tab-count" id="tab-count-failed">—</span></button>
|
|
221
|
+
<button class="job-tab" data-status="completed" type="button" onclick="setJobStatusFilter('completed')">Completed <span class="job-tab-count" id="tab-count-completed">—</span></button>
|
|
203
222
|
</div>
|
|
204
223
|
<div style="overflow-x: auto;">
|
|
205
224
|
<table id="jobs-table">
|
|
@@ -253,6 +272,9 @@ const getDashboardScriptState = (options) => String.raw `
|
|
|
253
272
|
let dashboardResetTimer = null;
|
|
254
273
|
let reconnectAttempts = 0;
|
|
255
274
|
let currentTheme = null;
|
|
275
|
+
const JOB_STATUS_FILTER_KEY = 'zintrust-queue-monitor-job-status-filter';
|
|
276
|
+
let currentJobStatusFilter = localStorage.getItem(JOB_STATUS_FILTER_KEY) || 'all';
|
|
277
|
+
let allJobsCache = [];
|
|
256
278
|
`;
|
|
257
279
|
const getDashboardScriptTheme = () => `
|
|
258
280
|
function getPreferredTheme() {
|
|
@@ -704,9 +726,8 @@ const getRenderJobsRowHelpersFunction = () => `
|
|
|
704
726
|
}
|
|
705
727
|
`;
|
|
706
728
|
const getRenderJobsFunction = () => `
|
|
707
|
-
function
|
|
729
|
+
function _renderJobsToDOM(jobList) {
|
|
708
730
|
const tbody = document.querySelector('#jobs-table tbody');
|
|
709
|
-
const jobList = Array.isArray(jobs) ? jobs : [];
|
|
710
731
|
|
|
711
732
|
if (jobList.length === 0) {
|
|
712
733
|
ensureEmptyJobsState(tbody);
|
|
@@ -736,7 +757,47 @@ const getRenderJobsFunction = () => `
|
|
|
736
757
|
|
|
737
758
|
expandedJobIds = new Set([...expandedJobIds].filter(id => currentJobIds.has(id)));
|
|
738
759
|
tbody.replaceChildren(fragment);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function renderJobs(jobs) {
|
|
763
|
+
allJobsCache = Array.isArray(jobs) ? jobs : [];
|
|
764
|
+
updateJobTabCounts(allJobsCache);
|
|
765
|
+
applyJobStatusFilter();
|
|
739
766
|
}`;
|
|
767
|
+
const getJobStatusTabsFunction = () => `
|
|
768
|
+
function updateJobTabCounts(jobs) {
|
|
769
|
+
const counts = { all: jobs.length, active: 0, waiting: 0, failed: 0, completed: 0 };
|
|
770
|
+
jobs.forEach(function(job) {
|
|
771
|
+
const status = (job.status || (job.failedReason ? 'failed' : 'completed')).toLowerCase();
|
|
772
|
+
if (Object.prototype.hasOwnProperty.call(counts, status)) {
|
|
773
|
+
counts[status]++;
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
Object.keys(counts).forEach(function(status) {
|
|
777
|
+
const el = document.getElementById('tab-count-' + status);
|
|
778
|
+
if (el) el.textContent = String(counts[status]);
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function applyJobStatusFilter() {
|
|
783
|
+
const filtered = currentJobStatusFilter === 'all'
|
|
784
|
+
? allJobsCache
|
|
785
|
+
: allJobsCache.filter(function(job) {
|
|
786
|
+
const status = (job.status || (job.failedReason ? 'failed' : 'completed')).toLowerCase();
|
|
787
|
+
return status === currentJobStatusFilter;
|
|
788
|
+
});
|
|
789
|
+
_renderJobsToDOM(filtered);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function setJobStatusFilter(status) {
|
|
793
|
+
currentJobStatusFilter = status;
|
|
794
|
+
localStorage.setItem(JOB_STATUS_FILTER_KEY, status);
|
|
795
|
+
document.querySelectorAll('.job-tab').forEach(function(btn) {
|
|
796
|
+
btn.classList.toggle('active-tab', btn.dataset.status === status);
|
|
797
|
+
});
|
|
798
|
+
applyJobStatusFilter();
|
|
799
|
+
}
|
|
800
|
+
`;
|
|
740
801
|
const getRenderLocksFunction = () => `
|
|
741
802
|
// Track expanded lock keys to preserve state during SSE updates
|
|
742
803
|
let expandedLockKeys = new Set();
|
|
@@ -994,7 +1055,7 @@ const getRecoverActiveJobFunction = () => `
|
|
|
994
1055
|
? 'Removed'
|
|
995
1056
|
: 'Recovered';
|
|
996
1057
|
setTimeout(() => {
|
|
997
|
-
|
|
1058
|
+
fetchData();
|
|
998
1059
|
}, 1000);
|
|
999
1060
|
} else {
|
|
1000
1061
|
btn.textContent = 'Failed';
|
|
@@ -1024,8 +1085,7 @@ const getRetryJobFunction = () => `
|
|
|
1024
1085
|
? '✓ Requeued'
|
|
1025
1086
|
: '✓ Retried';
|
|
1026
1087
|
setTimeout(() => {
|
|
1027
|
-
|
|
1028
|
-
// fetchJobs(currentQueue);
|
|
1088
|
+
fetchData();
|
|
1029
1089
|
}, 1000);
|
|
1030
1090
|
} else {
|
|
1031
1091
|
btn.textContent = '✗ Failed';
|
|
@@ -1197,11 +1257,7 @@ const getDashboardScriptEventStream = () => `
|
|
|
1197
1257
|
}
|
|
1198
1258
|
`;
|
|
1199
1259
|
const getFetchDataFunction = () => `
|
|
1200
|
-
// HTTP polling disabled - 100% SSE reliance
|
|
1201
1260
|
async function fetchData() {
|
|
1202
|
-
console.log('HTTP polling disabled - using SSE only');
|
|
1203
|
-
// Disabled to ensure 100% SSE streaming
|
|
1204
|
-
/*
|
|
1205
1261
|
try {
|
|
1206
1262
|
document.getElementById('error-container').style.display = 'none';
|
|
1207
1263
|
const res = await fetch(API_BASE + '/api/snapshot');
|
|
@@ -1209,18 +1265,26 @@ const getFetchDataFunction = () => `
|
|
|
1209
1265
|
const data = await res.json();
|
|
1210
1266
|
|
|
1211
1267
|
renderStats(data);
|
|
1212
|
-
updateQueueSelect(data.queues);
|
|
1268
|
+
const nextQueue = updateQueueSelect(data.queues || []);
|
|
1269
|
+
currentQueue = nextQueue;
|
|
1270
|
+
if (currentQueue) {
|
|
1271
|
+
localStorage.setItem(QUEUE_KEY, currentQueue);
|
|
1272
|
+
} else {
|
|
1273
|
+
localStorage.removeItem(QUEUE_KEY);
|
|
1274
|
+
}
|
|
1213
1275
|
handleQueueSelection(data);
|
|
1276
|
+
if (currentQueue) {
|
|
1277
|
+
await fetchJobs(currentQueue);
|
|
1278
|
+
}
|
|
1214
1279
|
await fetchLocks();
|
|
1215
1280
|
document.getElementById('last-updated').textContent = formatDateTime(new Date());
|
|
1216
1281
|
} catch (e) {
|
|
1217
1282
|
showError(e.message);
|
|
1218
1283
|
}
|
|
1219
|
-
*/
|
|
1220
1284
|
}
|
|
1221
1285
|
|
|
1222
1286
|
function handleQueueSelection(data) {
|
|
1223
|
-
if (data.queues.length > 0) {
|
|
1287
|
+
if (Array.isArray(data.queues) && data.queues.length > 0 && currentQueue) {
|
|
1224
1288
|
document.getElementById('queue-select').value = currentQueue;
|
|
1225
1289
|
} else {
|
|
1226
1290
|
document.getElementById('queue-select').innerHTML = '<option>No Queues</option>';
|
|
@@ -1229,35 +1293,33 @@ const getFetchDataFunction = () => `
|
|
|
1229
1293
|
}
|
|
1230
1294
|
`;
|
|
1231
1295
|
const getDashboardScriptFetch = () => `
|
|
1232
|
-
// HTTP polling disabled - 100% SSE reliance
|
|
1233
1296
|
async function fetchJobs(queue) {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1297
|
+
if (!queue) {
|
|
1298
|
+
renderJobs([]);
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1237
1301
|
try {
|
|
1238
|
-
const res = await fetch(API_BASE + '/api/jobs/' + queue);
|
|
1302
|
+
const res = await fetch(API_BASE + '/api/jobs/' + encodeURIComponent(queue));
|
|
1303
|
+
if (!res.ok) throw new Error('Failed to fetch jobs');
|
|
1239
1304
|
const jobs = await res.json();
|
|
1240
1305
|
renderJobs(jobs);
|
|
1241
1306
|
} catch (e) {
|
|
1242
1307
|
console.error('Failed to fetch jobs', e);
|
|
1308
|
+
showError(e.message);
|
|
1243
1309
|
}
|
|
1244
|
-
*/
|
|
1245
1310
|
}
|
|
1246
1311
|
|
|
1247
|
-
// HTTP polling disabled - 100% SSE reliance
|
|
1248
1312
|
async function fetchLocks() {
|
|
1249
|
-
console.log('HTTP locks polling disabled - using SSE only');
|
|
1250
|
-
// Disabled to ensure 100% SSE streaming
|
|
1251
|
-
/*
|
|
1252
1313
|
try {
|
|
1253
1314
|
const pattern = getLockPattern();
|
|
1254
1315
|
const res = await fetch(API_BASE + '/api/locks?pattern=' + encodeURIComponent(pattern));
|
|
1316
|
+
if (!res.ok) throw new Error('Failed to fetch locks');
|
|
1255
1317
|
const data = await res.json();
|
|
1256
1318
|
renderLocks(data);
|
|
1257
1319
|
} catch (e) {
|
|
1258
1320
|
console.error('Failed to fetch locks', e);
|
|
1321
|
+
showError(e.message);
|
|
1259
1322
|
}
|
|
1260
|
-
*/
|
|
1261
1323
|
}
|
|
1262
1324
|
`;
|
|
1263
1325
|
const getDashboardScriptRender = () => [
|
|
@@ -1270,6 +1332,7 @@ const getDashboardScriptRender = () => [
|
|
|
1270
1332
|
getRenderJobsEmptyStateFunction(),
|
|
1271
1333
|
getRenderJobsRowHelpersFunction(),
|
|
1272
1334
|
getRenderJobsFunction(),
|
|
1335
|
+
getJobStatusTabsFunction(),
|
|
1273
1336
|
getRenderLocksFunction(),
|
|
1274
1337
|
getLockHelperFunctions(),
|
|
1275
1338
|
getErrorAndTooltipFunctions(),
|
|
@@ -1297,9 +1360,9 @@ const getDashboardScriptBootstrap = () => `
|
|
|
1297
1360
|
} else {
|
|
1298
1361
|
localStorage.removeItem(QUEUE_KEY);
|
|
1299
1362
|
}
|
|
1300
|
-
console.log('Queue changed - SSE will update automatically');
|
|
1301
1363
|
clearError();
|
|
1302
1364
|
|
|
1365
|
+
fetchData();
|
|
1303
1366
|
setupEventStream(currentQueue);
|
|
1304
1367
|
});
|
|
1305
1368
|
}
|
|
@@ -1307,8 +1370,15 @@ const getDashboardScriptBootstrap = () => `
|
|
|
1307
1370
|
const lockRefresh = document.getElementById('lock-refresh');
|
|
1308
1371
|
if (lockRefresh) {
|
|
1309
1372
|
lockRefresh.addEventListener('click', () => {
|
|
1310
|
-
|
|
1311
|
-
|
|
1373
|
+
fetchLocks();
|
|
1374
|
+
setupEventStream(currentQueue);
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
const jobsRefresh = document.getElementById('jobs-refresh');
|
|
1379
|
+
if (jobsRefresh) {
|
|
1380
|
+
jobsRefresh.addEventListener('click', () => {
|
|
1381
|
+
fetchData();
|
|
1312
1382
|
setupEventStream(currentQueue);
|
|
1313
1383
|
});
|
|
1314
1384
|
}
|
|
@@ -1319,8 +1389,13 @@ const getDashboardScriptBootstrap = () => `
|
|
|
1319
1389
|
: storedAutoRefresh === 'true';
|
|
1320
1390
|
|
|
1321
1391
|
applyTheme(getPreferredTheme());
|
|
1322
|
-
|
|
1323
|
-
//
|
|
1392
|
+
|
|
1393
|
+
// Restore persisted status filter tab
|
|
1394
|
+
document.querySelectorAll('.job-tab').forEach(function(btn) {
|
|
1395
|
+
btn.classList.toggle('active-tab', btn.dataset.status === currentJobStatusFilter);
|
|
1396
|
+
});
|
|
1397
|
+
|
|
1398
|
+
fetchData();
|
|
1324
1399
|
setAutoRefresh(initialAutoRefresh);
|
|
1325
1400
|
|
|
1326
1401
|
setupEventStream(currentQueue);
|
package/dist/driver.js
CHANGED
|
@@ -377,7 +377,8 @@ const createBullMQRecoverActiveJob = (getQueue, getJob) => async (queueName, job
|
|
|
377
377
|
}
|
|
378
378
|
try {
|
|
379
379
|
job.discard();
|
|
380
|
-
const
|
|
380
|
+
const queueWithClient = queue;
|
|
381
|
+
const client = await queueWithClient.client;
|
|
381
382
|
await client.set(queue.toKey(jobId) + ':lock', 'pull-worker', 'PX', String(Math.max(1, Env.getInt('QUEUE_MONITOR_RECOVER_ACTIVE_LOCK_MS', 30_000))));
|
|
382
383
|
await job.moveToFailed(new Error('manual queue-monitor stale active recovery'), 'pull-worker', false);
|
|
383
384
|
return { ok: true, status: 'failed' };
|
package/package.json
CHANGED
package/dist/build-manifest.json
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zintrust/queue-monitor",
|
|
3
|
-
"version": "2.4.6",
|
|
4
|
-
"buildDate": "2026-06-11T20:48:32.186Z",
|
|
5
|
-
"buildEnvironment": {
|
|
6
|
-
"node": "v22.22.1",
|
|
7
|
-
"platform": "darwin",
|
|
8
|
-
"arch": "arm64"
|
|
9
|
-
},
|
|
10
|
-
"git": {
|
|
11
|
-
"commit": "5a1a7000",
|
|
12
|
-
"branch": "release"
|
|
13
|
-
},
|
|
14
|
-
"package": {
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20.0.0"
|
|
17
|
-
},
|
|
18
|
-
"dependencies": [
|
|
19
|
-
"bullmq",
|
|
20
|
-
"ioredis"
|
|
21
|
-
],
|
|
22
|
-
"peerDependencies": [
|
|
23
|
-
"@zintrust/core",
|
|
24
|
-
"@zintrust/redis-rpc"
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"files": {
|
|
28
|
-
"BrandFavicon.d.ts": {
|
|
29
|
-
"size": 81,
|
|
30
|
-
"sha256": "0f477b645fb3df6d3f52ced87c3c0f7dc942e5f4c4710f24866eca3b2e411fb9"
|
|
31
|
-
},
|
|
32
|
-
"BrandFavicon.js": {
|
|
33
|
-
"size": 721,
|
|
34
|
-
"sha256": "33e57f6cec15b8dcb5886ca92644139d2e3ca1789aae1c3a4a066d75a273a6bb"
|
|
35
|
-
},
|
|
36
|
-
"QueueMonitoringService.d.ts": {
|
|
37
|
-
"size": 1760,
|
|
38
|
-
"sha256": "949569e78120329804b63736b25c8cff9b5516ca44c9e7f1b2989d9cb09360b9"
|
|
39
|
-
},
|
|
40
|
-
"QueueMonitoringService.js": {
|
|
41
|
-
"size": 10048,
|
|
42
|
-
"sha256": "3b7e85e6a0ba5dd958010bdf023052b1fb66cfbb52047554b326b4465b817719"
|
|
43
|
-
},
|
|
44
|
-
"build-manifest.json": {
|
|
45
|
-
"size": 3871,
|
|
46
|
-
"sha256": "e528885f6647e617d567e6e7231f1abef4878bfee18c4a0b1cae7172984162cc"
|
|
47
|
-
},
|
|
48
|
-
"connection.d.ts": {
|
|
49
|
-
"size": 287,
|
|
50
|
-
"sha256": "dcc6ea45e59b0a2e8844b27f466dff4849618c06b74aae62a99c8edd772d0db0"
|
|
51
|
-
},
|
|
52
|
-
"connection.js": {
|
|
53
|
-
"size": 178,
|
|
54
|
-
"sha256": "ff387351f5b8c7c14a7f2ef817fbbb065ad677faffcb47e5e8ddc4b064747e5b"
|
|
55
|
-
},
|
|
56
|
-
"dashboard-index.d.ts": {
|
|
57
|
-
"size": 183,
|
|
58
|
-
"sha256": "9d7c7fc63fe2919de0584d3f3d0ef74166d834af0a68caca2fe6fe64340652b9"
|
|
59
|
-
},
|
|
60
|
-
"dashboard-index.js": {
|
|
61
|
-
"size": 183,
|
|
62
|
-
"sha256": "9d7c7fc63fe2919de0584d3f3d0ef74166d834af0a68caca2fe6fe64340652b9"
|
|
63
|
-
},
|
|
64
|
-
"dashboard-ui.d.ts": {
|
|
65
|
-
"size": 219,
|
|
66
|
-
"sha256": "5140191207b5620500ac5e1edacefed65956a1ad88739695d545ea7d2b405243"
|
|
67
|
-
},
|
|
68
|
-
"dashboard-ui.js": {
|
|
69
|
-
"size": 54132,
|
|
70
|
-
"sha256": "1a017b07922c7f37e4717547b2d97cfb76b2460a4f3c9659ec9e5c2a41ebf889"
|
|
71
|
-
},
|
|
72
|
-
"driver-index.d.ts": {
|
|
73
|
-
"size": 287,
|
|
74
|
-
"sha256": "915a41bc57b3a5d826832bd4a899861ddbfd15a66ab04f7a599454a248222480"
|
|
75
|
-
},
|
|
76
|
-
"driver-index.js": {
|
|
77
|
-
"size": 184,
|
|
78
|
-
"sha256": "fb91df973acd13a88cca443e50ecdd34944c66e1a1d48333f63099079a00f3c9"
|
|
79
|
-
},
|
|
80
|
-
"driver.d.ts": {
|
|
81
|
-
"size": 1417,
|
|
82
|
-
"sha256": "9aa9e6ac31d8a0a3d4145a8228bd61180be89e7170b02d1290fcb732a4c217a1"
|
|
83
|
-
},
|
|
84
|
-
"driver.js": {
|
|
85
|
-
"size": 12508,
|
|
86
|
-
"sha256": "c77e609af5d2c05b96fd5512c9597cb5e37c3e7a187cf8face4c94ce7fbc7990"
|
|
87
|
-
},
|
|
88
|
-
"index.d.ts": {
|
|
89
|
-
"size": 2344,
|
|
90
|
-
"sha256": "370b578ca6412fbdbb2f6966c0899a4c9d6d1ab08defe48a9004564124b1f45e"
|
|
91
|
-
},
|
|
92
|
-
"index.js": {
|
|
93
|
-
"size": 17226,
|
|
94
|
-
"sha256": "ea914e117c67999b35ebe5da07af9e4301a9360f522645be918ef3c541d1fa5c"
|
|
95
|
-
},
|
|
96
|
-
"metrics-index.d.ts": {
|
|
97
|
-
"size": 239,
|
|
98
|
-
"sha256": "b68d7ca4d15e2380bc7a57e8ff6b00eb19a9f49417f7df88ff20b93cd2aeb00d"
|
|
99
|
-
},
|
|
100
|
-
"metrics-index.js": {
|
|
101
|
-
"size": 171,
|
|
102
|
-
"sha256": "53e858995605858b819f2c48c701e3b8f7d028ec51c1b4814c46284c7fb3989e"
|
|
103
|
-
},
|
|
104
|
-
"metrics.d.ts": {
|
|
105
|
-
"size": 913,
|
|
106
|
-
"sha256": "c68b254af229871ae8d4ad5c2aca00108c07465e0abb336a68a9c2023d2d5776"
|
|
107
|
-
},
|
|
108
|
-
"metrics.js": {
|
|
109
|
-
"size": 3526,
|
|
110
|
-
"sha256": "bec6d546c15a4040eaf637feb974799db85cbdf34a7cb077f7b407da31181f11"
|
|
111
|
-
},
|
|
112
|
-
"runtime-index.d.ts": {
|
|
113
|
-
"size": 2230,
|
|
114
|
-
"sha256": "b4608f964f6c5cdb5469eb320683fee827734adcf1d03ea931766405451f35df"
|
|
115
|
-
},
|
|
116
|
-
"runtime-index.js": {
|
|
117
|
-
"size": 9948,
|
|
118
|
-
"sha256": "7aa5c97aef19ec36e1309b9abc922481924672e4017bc3fe198b5eff7dabda86"
|
|
119
|
-
},
|
|
120
|
-
"worker.d.ts": {
|
|
121
|
-
"size": 347,
|
|
122
|
-
"sha256": "fb7751246ae88f5f470107e35f25f561da5919fd2619fe70b8b182d0c878ac0e"
|
|
123
|
-
},
|
|
124
|
-
"worker.js": {
|
|
125
|
-
"size": 1376,
|
|
126
|
-
"sha256": "4f114198579d049482e284738cbdf35576d48bb269cc0936053911548efacb5d"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|