Update src/app/api/events/route.ts

Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
This commit is contained in:
zenchantlive 2026-02-14 00:38:11 -08:00 committed by GitHub
parent 6fb9824c11
commit d1140c9809
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,6 +75,15 @@ export async function GET(request: Request): Promise<Response> {
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) {