Fix db/events test, remove unnecessary AbortSignal from pipeline

This commit is contained in:
Alex Gleason 2023-12-29 21:21:56 -06:00
parent 3472428da8
commit 38238cc4a8
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 4 additions and 4 deletions

View File

@ -42,9 +42,9 @@ Deno.test('query events with local filter', async () => {
username: 'alex', username: 'alex',
pubkey: event1.pubkey, pubkey: event1.pubkey,
inserted_at: new Date(), inserted_at: new Date(),
admin: 0, admin: false,
}); });
assertEquals(await db.getEvents([{ local: true }]), [event1]); assertEquals(await db.getEvents([{ kinds: [1], local: true }]), [event1]);
assertEquals(await db.getEvents([{ local: false }]), []); assertEquals(await db.getEvents([{ kinds: [1], local: false }]), []);
}); });

View File

@ -71,7 +71,7 @@ async function storeEvent(event: Event, data: EventData, opts: StoreEventOpts =
if (force || data.user || isAdminEvent(event) || await isLocallyFollowed(event.pubkey)) { if (force || data.user || isAdminEvent(event) || await isLocallyFollowed(event.pubkey)) {
const [deletion] = await eventsDB.getEvents( const [deletion] = await eventsDB.getEvents(
[{ kinds: [5], authors: [event.pubkey], '#e': [event.id], limit: 1 }], [{ kinds: [5], authors: [event.pubkey], '#e': [event.id], limit: 1 }],
{ limit: 1, signal: AbortSignal.timeout(Time.seconds(1)) }, { limit: 1 },
); );
if (deletion) { if (deletion) {