Scheduling infrastructure for absolutely everyone.
chore: Log cold starts of /v1/slots (#16468)
Keith Williams6bb60e36fd94
diff --git a/apps/api/v1/pages/api/slots/_get.ts b/apps/api/v1/pages/api/slots/_get.tsindex 3f6ef9b29c4..e4323d00373 100644--- a/apps/api/v1/pages/api/slots/_get.ts+++ b/apps/api/v1/pages/api/slots/_get.ts@@ -3,6 +3,7 @@ import utc from "dayjs/plugin/utc";import type { NextApiRequest, NextApiResponse } from "next";import dayjs from "@calcom/dayjs";+import { IS_PRODUCTION } from "@calcom/lib/constants";import { isSupportedTimeZone } from "@calcom/lib/date-fns";import { HttpError } from "@calcom/lib/http-error";import { defaultResponder } from "@calcom/lib/server";@@ -17,8 +18,15 @@ import { getHTTPStatusCodeFromError } from "@trpc/server/http";dayjs.extend(utc);dayjs.extend(timezone);+let isColdStart = true;+async function handler(req: NextApiRequest, res: NextApiResponse) {try {+ if (isColdStart && IS_PRODUCTION) {+ console.log("Cold start of /v1/slots detected");+ isColdStart = false;+ }+const { usernameList, ...rest } = req.query;let slugs = usernameList;if (!Array.isArray(usernameList)) {