23 lines
675 B
TypeScript
23 lines
675 B
TypeScript
import "server-only";
|
|
|
|
import { cacheLife, cacheTag } from "next/cache";
|
|
|
|
import { getStygianSchedule, listStygianSchedules } from "@/lib/stygian/repository";
|
|
import { STYGIAN_CACHE_TAG } from "@/lib/cache/tags";
|
|
|
|
export { STYGIAN_CACHE_TAG };
|
|
|
|
export async function getCachedStygianSchedule(scheduleId: number) {
|
|
"use cache: remote";
|
|
cacheLife({ stale: 30, revalidate: 60, expire: 60 * 60 });
|
|
cacheTag(STYGIAN_CACHE_TAG);
|
|
return getStygianSchedule(scheduleId);
|
|
}
|
|
|
|
export async function getCachedStygianSchedules() {
|
|
"use cache: remote";
|
|
cacheLife({ stale: 30, revalidate: 60, expire: 60 * 60 });
|
|
cacheTag(STYGIAN_CACHE_TAG);
|
|
return listStygianSchedules();
|
|
}
|