fix: remove debug logging from queryNostr, keep clean production server

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-06-17 12:02:09 +07:00
parent 4c263e729a
commit c772330e74

View file

@ -47,21 +47,16 @@ const dataPool = new SimplePool();
async function queryNostr(filters: Filter[], timeoutMs = 8000): Promise<any[]> {
// nostr-tools v2: use querySync which handles eose cleanly
// Run each filter separately and merge results (querySync takes a single filter)
const allEvents: any[] = [];
await Promise.all(
filters.map(async (filter) => {
try {
const abort = new AbortController();
const timer = setTimeout(() => abort.abort(), timeoutMs);
const events = await dataPool.querySync(NOSTR_RELAYS, filter, {
maxWait: timeoutMs,
abort: abort.signal,
});
clearTimeout(timer);
allEvents.push(...events);
} catch {
// ignore per-filter errors
} catch (err) {
console.error("[queryNostr] error:", err);
}
})
);