mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
26 lines
545 B
TypeScript
26 lines
545 B
TypeScript
import { Storages } from '@/storages.ts';
|
|
import { EventsDB } from '@/storages/EventsDB.ts';
|
|
|
|
const store = await Storages.db();
|
|
const kysely = await Storages.kysely();
|
|
|
|
for await (const msg of store.req([{}])) {
|
|
if (msg[0] === 'EVENT') {
|
|
const event = msg[2];
|
|
|
|
const ext = EventsDB.indexExtensions(event);
|
|
|
|
try {
|
|
await kysely.updateTable('nostr_events')
|
|
.set('search_ext', ext)
|
|
.where('id', '=', event.id)
|
|
.execute();
|
|
} catch {
|
|
// do nothing
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
|
|
Deno.exit();
|