Skip to content

Commit a082b80

Browse files
committed
Modify time to refresh viewer data
1 parent 597a8eb commit a082b80

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

netlify/edge-functions/visitors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getStore } from "@netlify/blobs";
22
import type { Config, Context } from "@netlify/edge-functions";
33

44
const VISITORS_KEY = "visitor_counts";
5-
const CACHE_TTL = 15;
5+
const CACHE_TTL = 30;
66
const MAX_HISTORY_POINTS = 8;
77
const SITE_ID = "EPXKTQED";
88

@@ -255,8 +255,8 @@ async function handleSSE(request: Request): Promise<Response> {
255255
// Send initial data
256256
await sendStats();
257257

258-
// Update every 15 seconds
259-
const timer = setInterval(sendStats, 15000);
258+
// Update every 30 seconds
259+
const timer = setInterval(sendStats, 30000);
260260

261261
request.signal.addEventListener("abort", () => {
262262
clearInterval(timer);

0 commit comments

Comments
 (0)