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 01:18:53 -08:00 committed by GitHub
parent 3b692e894c
commit cf5f55d294
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,15 +77,6 @@ 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) {
@ -105,10 +96,6 @@ export async function GET(request: Request): Promise<Response> {
lastTouchedVersion = nextVersion;
write(toSseFrame(issuesEventBus.emit(projectRoot, lastTouchedPath, 'changed')));
}
} finally {
isPolling = false;
}
};
const touchedPoll = setInterval(() => {
void pollLastTouched();