server for refapp and refbot and other stuff
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: load active event + generated pools into cache on boot

alpine (Jul 16, 2026, 5:21 AM +0200) ac3f41bd 56de9cea

+8
+8
src/index.ts
··· 5 5 import { createWsServer, broadcast } from './ws.js'; 6 6 import { ensureBootstrapApiKey } from './bootstrap.js'; 7 7 import { setBroadcast } from './engine/match.js'; 8 + import { loadActiveEvent } from './engine/event.js'; 9 + import { loadGeneratedPoolsFromDB } from './engine/pools.js'; 8 10 import { logger } from './logger.js'; 9 11 10 12 async function main(): Promise<void> { ··· 15 17 16 18 await connectDB(); 17 19 await ensureBootstrapApiKey(); 20 + 21 + // Load the active event + any generated pools into the in-memory engine 22 + // caches so endpoints that rely on getActiveEvent()/getGeneratedPools() 23 + // work immediately after a restart (mirrors the bot's boot-time load). 24 + await loadActiveEvent(); 25 + await loadGeneratedPoolsFromDB(); 18 26 19 27 const app = createApp(); 20 28 const httpServer = createServer(app);