Reduce timeouts

This commit is contained in:
Alex Gleason
2024-07-01 09:18:42 +01:00
parent c3ffe7c7f7
commit 092a20088a
2 changed files with 6 additions and 6 deletions

View File

@@ -73,7 +73,7 @@ function connectStream(socket: WebSocket) {
const pubsub = await Storages.pubsub();
try {
for (const event of await store.query(filters, { limit: FILTER_LIMIT, timeout: 500 })) {
for (const event of await store.query(filters, { limit: FILTER_LIMIT, timeout: 300 })) {
send(['EVENT', subId, event]);
}
} catch (e) {
@@ -128,7 +128,7 @@ function connectStream(socket: WebSocket) {
/** Handle COUNT. Return the number of events matching the filters. */
async function handleCount([_, subId, ...filters]: NostrClientCOUNT): Promise<void> {
const store = await Storages.db();
const { count } = await store.count(filters, { timeout: 500 });
const { count } = await store.count(filters, { timeout: 100 });
send(['COUNT', subId, { count, approximate: false }]);
}