Skip to content
Source
Sign inSign up
samwillis/hackernews-realtime
Open History to see the last commit

thread-load.ts

10 lines303 Bytes

1import "server-only";
2import { databasePool } from "./db";
3import { loadThread } from "../ingest/thread-load";
4export async function ensureThreadLoaded(id: number) {
5 try {
6 await loadThread(databasePool(), id);
7 } catch {
8 // SSR still opens with cached rows; the live worker retries HN.
9 }