Skip to content

Commit

Permalink
remove cold starts log (calcom#9137)
Browse files Browse the repository at this point in the history
Co-authored-by: alannnc <[email protected]>
Co-authored-by: Bailey Pumfleet <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Omar López <[email protected]>
  • Loading branch information
5 people authored May 30, 2023
1 parent 6faa9c0 commit d3ed637
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions apps/web/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@ import { CONSOLE_URL, WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants";
import { isIpInBanlist } from "@calcom/lib/getIP";
import { extendEventData, nextCollectBasicSettings } from "@calcom/lib/telemetry";

let cold = true;

const middleware: NextMiddleware = async (req) => {
const url = req.nextUrl;
const requestHeaders = new Headers(req.headers);

// This console.log is required to create a report in axios for hot and cold requests
console.log(cold ? "Cold Start" : "Hot Start");
requestHeaders.set("x-cal-cold-start", cold ? "true" : "false");
cold = false;
if (!url.pathname.startsWith("/api")) {
//
// NOTE: When tRPC hits an error a 500 is returned, when this is received
Expand Down

0 comments on commit d3ed637

Please sign in to comment.