From d1140c980945d2a498a6c9e6fee7f6d8a0cc8cd5 Mon Sep 17 00:00:00 2001 From: zenchantlive <103866469+zenchantlive@users.noreply.github.com> Date: Sat, 14 Feb 2026 00:38:11 -0800 Subject: [PATCH] Update src/app/api/events/route.ts Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> --- src/app/api/events/route.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/api/events/route.ts b/src/app/api/events/route.ts index 04dfe22..f6809d9 100644 --- a/src/app/api/events/route.ts +++ b/src/app/api/events/route.ts @@ -75,6 +75,15 @@ export async function GET(request: Request): Promise { const lastTouchedPath = path.join(projectRoot, '.beads', 'last-touched'); let lastTouchedVersion: number | null = null; + let isPolling = false; + const pollLastTouched = async () => { + if (isPolling) { + return; + } + isPolling = true; + try { + const nextVersion = await readLastTouchedVersion(lastTouchedPath); + if (nextVersion === null) { let isPolling = false; const pollLastTouched = async () => { if (isPolling) {