From bc87abf5c2eb550784b424e76b6623ef029aa9e9 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Fri, 3 Mar 2023 05:57:36 +0800 Subject: [PATCH] Fix: Clear uptime cache on push beat --- server/routers/api-router.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/routers/api-router.js b/server/routers/api-router.js index 2d5f9661..a36159ca 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -7,6 +7,7 @@ const dayjs = require("dayjs"); const { UP, MAINTENANCE, DOWN, PENDING, flipStatus, log } = require("../../src/util"); const StatusPage = require("../model/status_page"); const { UptimeKumaServer } = require("../uptime-kuma-server"); +const { UptimeCacheList } = require("../uptime-cache-list"); const { makeBadge } = require("badge-maker"); const { badgeConstants } = require("../config"); @@ -86,6 +87,7 @@ router.get("/api/push/:pushToken", async (request, response) => { await R.store(bean); io.to(monitor.user_id).emit("heartbeat", bean.toJSON()); + UptimeCacheList.clearCache(monitor.id); Monitor.sendStats(io, monitor.id, monitor.user_id); response.json({