Files
snort/packages/app/src/Cache/index.ts
2023-06-17 19:42:09 +01:00

20 lines
618 B
TypeScript

import { UserProfileCache, UserRelaysCache, RelayMetricCache } from "@snort/system";
import { DmCache } from "./DMCache";
import { InteractionCache } from "./EventInteractionCache";
export const UserCache = new UserProfileCache();
export const UserRelays = new UserRelaysCache();
export const RelayMetrics = new RelayMetricCache();
export { DmCache };
export async function preload(follows?: Array<string>) {
const preloads = [
UserCache.preload(follows),
DmCache.preload(),
InteractionCache.preload(),
UserRelays.preload(follows),
RelayMetrics.preload(),
];
await Promise.all(preloads);
}