mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
pipeline: remove "event already in database" check
This commit is contained in:
parent
8155fae89a
commit
4df61c0c59
1 changed files with 0 additions and 8 deletions
|
|
@ -40,7 +40,6 @@ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise<void
|
|||
}
|
||||
if (!(await verifyEventWorker(event))) return;
|
||||
if (encounterEvent(event)) return;
|
||||
if (await existsInDB(event)) return;
|
||||
|
||||
console.info(`NostrEvent<${event.kind}> ${event.id}`);
|
||||
pipelineEventsCounter.inc({ kind: event.kind });
|
||||
|
|
@ -111,13 +110,6 @@ function encounterEvent(event: NostrEvent): boolean {
|
|||
return encountered;
|
||||
}
|
||||
|
||||
/** Check if the event already exists in the database. */
|
||||
async function existsInDB(event: DittoEvent): Promise<boolean> {
|
||||
const store = await Storages.db();
|
||||
const events = await store.query([{ ids: [event.id], limit: 1 }]);
|
||||
return events.length > 0;
|
||||
}
|
||||
|
||||
/** Check whether the event has a NIP-70 `-` tag. */
|
||||
function isProtectedEvent(event: NostrEvent): boolean {
|
||||
return event.tags.some(([name]) => name === '-');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue