mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-22 16:04:18 +01:00
Fix db/events test, remove unnecessary AbortSignal from pipeline
This commit is contained in:
@@ -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 }]), []);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user