mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
Removed all caching and logging functionality from prisma.ts, keeping only the basic Prisma client initialization logic. This includes: - Removal of getProblems, getCachedProblems, getProblem, getCachedProblem functions - Removal of related logger and cache imports - Simplified the global prisma client instantiation
14 lines
312 B
TypeScript
14 lines
312 B
TypeScript
import "server-only";
|
|
|
|
import { PrismaClient } from "@/generated/client";
|
|
|
|
const globalForPrisma = global as unknown as {
|
|
prisma: PrismaClient;
|
|
};
|
|
|
|
const prisma = globalForPrisma.prisma || new PrismaClient();
|
|
|
|
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
|
|
|
|
export default prisma;
|