monitor import/export

This commit is contained in:
Alex Holliday committed 2025-11-20 23:27:30 +00:00
1 parent af6fede1b3
commit 6881be7555
12 files changed
+381 -154

No files matched your search

@@ -96,9 +96,12 @@ class StatusService implements IStatusService {
statusResponse: StatusResponse,
statusChanged: boolean
) => {
const stats = await MonitorStats.findOne({ monitorId: monitor._id });
let stats = await MonitorStats.findOne({ monitorId: monitor._id });
if (!stats) {
throw new ApiError("MonitorStats not found", 500);
stats = await MonitorStats.create({
monitorId: monitor._id,
currentStreakStartedAt: Date.now(),
});
}
// Update check counts