fix: remove debug logging from queryNostr, keep clean production server
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
parent
4c263e729a
commit
c772330e74
1 changed files with 2 additions and 7 deletions
|
|
@ -47,21 +47,16 @@ const dataPool = new SimplePool();
|
||||||
|
|
||||||
async function queryNostr(filters: Filter[], timeoutMs = 8000): Promise<any[]> {
|
async function queryNostr(filters: Filter[], timeoutMs = 8000): Promise<any[]> {
|
||||||
// nostr-tools v2: use querySync which handles eose cleanly
|
// nostr-tools v2: use querySync which handles eose cleanly
|
||||||
// Run each filter separately and merge results (querySync takes a single filter)
|
|
||||||
const allEvents: any[] = [];
|
const allEvents: any[] = [];
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
filters.map(async (filter) => {
|
filters.map(async (filter) => {
|
||||||
try {
|
try {
|
||||||
const abort = new AbortController();
|
|
||||||
const timer = setTimeout(() => abort.abort(), timeoutMs);
|
|
||||||
const events = await dataPool.querySync(NOSTR_RELAYS, filter, {
|
const events = await dataPool.querySync(NOSTR_RELAYS, filter, {
|
||||||
maxWait: timeoutMs,
|
maxWait: timeoutMs,
|
||||||
abort: abort.signal,
|
|
||||||
});
|
});
|
||||||
clearTimeout(timer);
|
|
||||||
allEvents.push(...events);
|
allEvents.push(...events);
|
||||||
} catch {
|
} catch (err) {
|
||||||
// ignore per-filter errors
|
console.error("[queryNostr] error:", err);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue