refactor: migrate chats to relay worker cache
This commit is contained in:
@ -3,10 +3,9 @@ import { SnortSystemDb } from "@snort/system-web";
|
||||
import { WorkerRelayInterface } from "@snort/worker-relay";
|
||||
import WorkerRelayPath from "@snort/worker-relay/dist/worker?worker&url";
|
||||
|
||||
import { ChatCache } from "./ChatCache";
|
||||
import { EventCacheWorker } from "./EventCacheWorker";
|
||||
import { GiftWrapCache } from "./GiftWrapCache";
|
||||
import { ProfileCacheRelayWorker } from "./ProfileWorkeCache";
|
||||
import { ProfileCacheRelayWorker } from "./ProfileWorkerCache";
|
||||
|
||||
export const Relay = new WorkerRelayInterface(WorkerRelayPath);
|
||||
export async function initRelayWorker() {
|
||||
@ -24,13 +23,11 @@ export const RelayMetrics = new RelayMetricCache(SystemDb.relayMetrics);
|
||||
export const UserCache = new ProfileCacheRelayWorker(Relay);
|
||||
export const EventsCache = new EventCacheWorker(Relay);
|
||||
|
||||
export const Chats = new ChatCache();
|
||||
export const GiftsCache = new GiftWrapCache();
|
||||
|
||||
export async function preload(follows?: Array<string>) {
|
||||
const preloads = [
|
||||
UserCache.preload(),
|
||||
Chats.preload(),
|
||||
RelayMetrics.preload(),
|
||||
GiftsCache.preload(),
|
||||
UserRelays.preload(follows),
|
||||
|
Reference in New Issue
Block a user