1
2
3
4
5
6
7
8
9
10
11
import { blob } from "https://esm.town/v/std/blob?v=12";
import { msMinute } from "https://esm.town/v/stevekrouse/msMinute";
export let intervalMonitor = async (req) => {
const intervalMonitorUpdatedAt = await blob.getJSON("intervalMonitorUpdatedAt");
if (Date.now() - intervalMonitorUpdatedAt > 5 * msMinute) {
return new Response(null, { status: 500 });
} else {
return Response.json({ lastIntervalCheck: intervalMonitorUpdatedAt });
}
};