Skip to content

Scheduling infrastructure for absolutely everyone.

move caching time constant to API

Agusti Fernandez Pardof3d7922efd3d
diff --git a/lib/constants.ts b/lib/constants.ts
new file mode 100644
index 00000000000..52c7fe0a41c
--- /dev/null
+++ b/lib/constants.ts
@@ -0,0 +1 @@
+export const PRISMA_CLIENT_CACHING_TIME = 1000 * 60 * 60 * 24;
diff --git a/lib/helpers/customPrisma.ts b/lib/helpers/customPrisma.ts
index 27846f31488..dc9bbeeaa3f 100644
--- a/lib/helpers/customPrisma.ts
+++ b/lib/helpers/customPrisma.ts
@@ -2,9 +2,9 @@ import { hash } from "bcryptjs";
import cache from "memory-cache";
import { NextMiddleware } from "next-api-middleware";
+import { PRISMA_CLIENT_CACHING_TIME } from "@calcom/api/lib/constants";
import { prismaAdmin } from "@calcom/console/modules/common/utils/prisma";
import { asStringOrUndefined } from "@calcom/lib/asStringOrNull";
-import { PRISMA_CLIENT_CACHING_TIME } from "@calcom/lib/constants";
import { prisma, customPrisma } from "@calcom/prisma";
// This replaces the prisma client for the cusotm one if the customCredentialsId is valid