Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.3 kB ยท 37 lines
TypeScript
1234567891011121314151617181920212223242526272829303132333435363738import { getExternalServiceBySlug, listExternalServices,} from "@openstatus/services/external-service";import { getExternalComponentBySlug, listExternalComponentsBySlug,} from "@openstatus/services/external-service-component";import { unstable_cache } from "next/cache";
const REVALIDATE_SECONDS = 60;const TAG = "external-services";
export const cachedListExternalServices = unstable_cache( async () => listExternalServices({}), ["external-services:list"], { revalidate: REVALIDATE_SECONDS, tags: [TAG] },);
export const cachedGetExternalServiceBySlug = unstable_cache( async (slug: string) => getExternalServiceBySlug({ slug }), ["external-services:by-slug"], { revalidate: REVALIDATE_SECONDS, tags: [TAG] },);
export const cachedListExternalComponentsBySlug = unstable_cache( async (slug: string) => listExternalComponentsBySlug({ slug }), ["external-service-components:by-service"], { revalidate: REVALIDATE_SECONDS, tags: [TAG] },);
export const cachedGetExternalComponentBySlug = unstable_cache( async (serviceSlug: string, componentSlug: string) => getExternalComponentBySlug({ serviceSlug, componentSlug }), ["external-service-components:by-slug"], { revalidate: REVALIDATE_SECONDS, tags: [TAG] },);