refactor: Remove unused caching logic in getPoolForDbId function
Deploy Application / deploy (push) Successful in 32s Details

This commit is contained in:
faisolavolut 2025-10-29 15:15:14 +07:00
parent be5461e7da
commit 2ad6c2759f
1 changed files with 7 additions and 7 deletions

View File

@ -28,12 +28,12 @@ function buildConnString(db: {
} }
export async function getPoolForDbId(db_id: string) { export async function getPoolForDbId(db_id: string) {
const now = Date.now(); // const now = Date.now();
const cached = poolCache.get(db_id); // const cached = poolCache.get(db_id);
if (cached) { // if (cached) {
cached.lastUsed = now; // cached.lastUsed = now;
return cached.pool; // return cached.pool;
} // }
// load credentials from central metadata table (prisma database model) // load credentials from central metadata table (prisma database model)
const dbRec = await prisma.database.findUnique({ where: { db_id } }); const dbRec = await prisma.database.findUnique({ where: { db_id } });
@ -59,7 +59,7 @@ export async function getPoolForDbId(db_id: string) {
idleTimeoutMillis: 30000, idleTimeoutMillis: 30000,
}); });
poolCache.set(db_id, { pool, lastUsed: now }); // poolCache.set(db_id, { pool, lastUsed: Date.now() });
return pool; return pool;
} }