refactor: Remove unused caching logic in getPoolForDbId function
Deploy Application / deploy (push) Successful in 32s
Details
Deploy Application / deploy (push) Successful in 32s
Details
This commit is contained in:
parent
be5461e7da
commit
2ad6c2759f
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue