This commit is contained in:
Alex Holliday committed 2026-01-16 18:17:55 +00:00
1 parent 95cd33ac06
commit 5784fec3d1
2 files changed
+19 -21

No files matched your search

@@ -217,24 +217,24 @@ class SuperSimpleQueue implements ISuperSimpleQueue {
}; };
getJobs = async () => { getJobs = async () => {
const jobs = await this.scheduler.getJobs(); const jobs = await this.scheduler.getJobs();
return jobs.map((job) => { return jobs.map((job) => {
return { return {
monitorId: job.id, monitorId: job.id,
monitorUrl: job?.data?.url || null, monitorUrl: job?.data?.url || null,
monitorType: job?.data?.type || null, monitorType: job?.data?.type || null,
monitorInterval: job?.data?.interval || null, monitorInterval: job?.data?.interval || null,
active: job.active, active: job.active,
lockedAt: job.lockedAt ?? null, lockedAt: job.lockedAt ?? null,
runCount: job.runCount ?? 0, runCount: job.runCount ?? 0,
failCount: job.failCount ?? 0, failCount: job.failCount ?? 0,
failReason: job.lastFailReason ?? null, failReason: job.lastFailReason ?? null,
lastRunAt: job.lastRunAt ?? null, lastRunAt: job.lastRunAt ?? null,
lastFinishedAt: job.lastFinishedAt ?? null, lastFinishedAt: job.lastFinishedAt ?? null,
lastRunTook: job.lockedAt ? null : (job.lastFinishedAt ?? 0) - (job.lastRunAt ?? 0), lastRunTook: job.lockedAt ? null : (job.lastFinishedAt ?? 0) - (job.lastRunAt ?? 0),
lastFailedAt: job.lastFailedAt ?? null, lastFailedAt: job.lastFailedAt ?? null,
}; };
}); });
}; };
flushQueues = async () => { flushQueues = async () => {
+1 -3
View File
@@ -42,9 +42,7 @@ describe("SuperSimpleQueueHelper", () => {
const { helper } = createHelper({ const { helper } = createHelper({
networkService: { requestStatus: jest.fn().mockResolvedValue(networkResponse) }, networkService: { requestStatus: jest.fn().mockResolvedValue(networkResponse) },
statusService: { statusService: {
updateMonitorStatus: jest updateMonitorStatus: jest.fn().mockResolvedValue({ monitor: updatedMonitor, statusChanged: true, prevStatus: false }),
.fn()
.mockResolvedValue({ monitor: updatedMonitor, statusChanged: true, prevStatus: false }),
}, },
notificationService: { handleNotifications: jest.fn().mockResolvedValue(undefined) }, notificationService: { handleNotifications: jest.fn().mockResolvedValue(undefined) },
}); });