refactor: Remove unnecessary console logs from event polling and retrieval

This commit is contained in:
Arunavo Ray
2025-05-24 18:41:55 +05:30
parent 47e1c7b493
commit d925b3c155
2 changed files with 17 additions and 34 deletions

View File

@@ -34,8 +34,6 @@ export const GET: APIRoute = async ({ request }) => {
if (isClosed) return;
try {
console.log(`Polling for events for user ${userId} in channel ${channel}`);
// Get new events from SQLite
const events = await getNewEvents({
userId,
@@ -43,8 +41,6 @@ export const GET: APIRoute = async ({ request }) => {
lastEventTime,
});
console.log(`Found ${events.length} new events`);
// Send events to client
if (events.length > 0) {
// Update last event time
@@ -52,7 +48,6 @@ export const GET: APIRoute = async ({ request }) => {
// Send each event to the client
for (const event of events) {
console.log(`Sending event: ${JSON.stringify(event.payload)}`);
sendMessage(`data: ${JSON.stringify(event.payload)}\n\n`);
}
}