Refactor Storages to get lazy-loaded only when they are used

This commit is contained in:
Alex Gleason
2024-05-01 14:56:47 -05:00
parent a6681a97d9
commit c190d2c8ce
27 changed files with 175 additions and 140 deletions

View File

@@ -1,5 +1,5 @@
import { type AppController } from '@/app.ts';
import { eventsDB } from '@/storages.ts';
import { Storages } from '@/storages.ts';
import { getTagSet } from '@/tags.ts';
import { renderAccounts } from '@/views.ts';
@@ -8,7 +8,7 @@ const blocksController: AppController = async (c) => {
const pubkey = c.get('pubkey')!;
const { signal } = c.req.raw;
const [event10000] = await eventsDB.query(
const [event10000] = await Storages.db.query(
[{ kinds: [10000], authors: [pubkey], limit: 1 }],
{ signal },
);