Fix Prisma
1 fix: error koneksi Prisma dengan retry mechanism
2
3 Perubahan:
4 - src/lib/prisma.ts: Tambah retry (3x) dengan exponential backoff saat connect
5 - src/lib/prisma-retry.ts: NEW - Utility wrapper untuk retry operations
6 - src/app/api/user-validate/route.ts: Improve error logging dengan detail
7 - src/middleware.tsx: Clean up commented code
8
9 Fitur:
10 - Auto retry saat database connection gagal
11 - Explicit () di production
12 - Better error logging untuk debugging
13 - Reusable retry wrapper (withRetry, withTimeout)
14
15 Testing:
16 - Build berhasil ✅
17 - Type checking passed ✅
18
19 Fixes: Error in PostgreSQL connection: Error { kind: Closed, cause: None }
### No Issue
This commit is contained in:
@@ -66,10 +66,6 @@ export const middleware = async (req: NextRequest) => {
|
||||
const { pathname } = req.nextUrl;
|
||||
|
||||
const apiBaseUrl = process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
|
||||
// Removed excessive logging that was causing high CPU usage
|
||||
// const dbUrl = process.env.DATABASE_URL;
|
||||
// console.log("DATABASE_URL >>", dbUrl);
|
||||
// console.log("URL Access >>", req.url);
|
||||
|
||||
// Handle CORS preflight
|
||||
const corsResponse = handleCors(req);
|
||||
|
||||
Reference in New Issue
Block a user