perf : cache
This commit is contained in:
@@ -11,7 +11,7 @@ import { CommentBoardSkeleton } from "@/components/comments/comment-skeleton";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { getCachedStygianSchedule, getCachedStygianSchedules } from "@/lib/cache/stygian";
|
||||
import { getActiveCatalog } from "@/lib/guides/queries";
|
||||
import { getCachedCatalogOptions } from "@/lib/cache/catalog";
|
||||
|
||||
export const instant = false;
|
||||
|
||||
@@ -22,7 +22,7 @@ export default async function StygianPage({ searchParams }: { searchParams: Prom
|
||||
const rawSchedule = Array.isArray(query.schedule) ? query.schedule[0] : query.schedule;
|
||||
const requestedId = Number(rawSchedule);
|
||||
const selectedId = schedules.some((entry) => entry.scheduleId === requestedId) ? requestedId : schedules[0]?.scheduleId;
|
||||
const [schedule, catalog] = await Promise.all([selectedId ? getCachedStygianSchedule(selectedId) : null, getActiveCatalog()]);
|
||||
const [schedule, catalog] = await Promise.all([selectedId ? getCachedStygianSchedule(selectedId) : null, getCachedCatalogOptions()]);
|
||||
return (
|
||||
<div className="flex min-h-svh flex-col bg-background">
|
||||
<LiveRefresh endpoint="/api/events/stygian" />
|
||||
|
||||
Reference in New Issue
Block a user