Increase timeout for account statuses endpoint and feed endpoints

This commit is contained in:
Alex Gleason 2024-07-02 20:13:44 +01:00
parent c7092f5d2d
commit 3e7bab538a
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 5 additions and 3 deletions

View file

@ -209,7 +209,9 @@ const accountStatusesController: AppController = async (c) => {
filter['#t'] = [tagged]; filter['#t'] = [tagged];
} }
const events = await store.query([filter], { signal }) const opts = { signal, limit, timeout: 10_000 };
const events = await store.query([filter], opts)
.then((events) => hydrateEvents({ events, store, signal })) .then((events) => hydrateEvents({ events, store, signal }))
.then((events) => { .then((events) => {
if (exclude_replies) { if (exclude_replies) {

View file

@ -78,7 +78,7 @@ async function renderNotifications(
const store = c.get('store'); const store = c.get('store');
const pubkey = await c.get('signer')?.getPublicKey()!; const pubkey = await c.get('signer')?.getPublicKey()!;
const { signal } = c.req.raw; const { signal } = c.req.raw;
const opts = { signal, limit: params.limit, timeout: 10_000 }; const opts = { signal, limit: params.limit, timeout: 15_000 };
const events = await store const events = await store
.query(filters, opts) .query(filters, opts)

View file

@ -60,7 +60,7 @@ const suggestedTimelineController: AppController = async (c) => {
async function renderStatuses(c: AppContext, filters: NostrFilter[]) { async function renderStatuses(c: AppContext, filters: NostrFilter[]) {
const { signal } = c.req.raw; const { signal } = c.req.raw;
const store = c.get('store'); const store = c.get('store');
const opts = { signal, timeout: 5000 }; const opts = { signal, timeout: 10_000 };
const events = await store const events = await store
.query(filters, opts) .query(filters, opts)