File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -25,5 +25,6 @@ export const GENERATE_TYPES =
2525export const GENERATE_TYPES_INCLUDED_SCHEMAS =
2626 GENERATE_TYPES && process . argv [ 5 ] === '--include-schemas' ? process . argv [ 6 ] ?. split ( ',' ) ?? [ ] : [ ]
2727
28+ export const CONNECTIONS_CACHE_SIZE = Number ( process . env . PG_META_CONNECTIONS_CACHE_SIZE || '100' )
2829export const DEFAULT_POOL_CONFIG = { max : 1 , connectionTimeoutMillis : PG_CONN_TIMEOUT_SECS * 1000 }
2930export const PG_META_REQ_HEADER = process . env . PG_META_REQ_HEADER || 'request-id'
Original file line number Diff line number Diff line change 11import LruCache from 'lru-cache'
22import PostgresMeta from '../lib/PostgresMeta.js'
3- import { DEFAULT_POOL_CONFIG } from './constants.js'
3+ import { CONNECTIONS_CACHE_SIZE , DEFAULT_POOL_CONFIG } from './constants.js'
44
55const cache = new LruCache < string , PostgresMeta > ( {
6- max : 100 ,
6+ max : CONNECTIONS_CACHE_SIZE ,
77 dispose : async ( value ) => {
88 await value . end ( )
99 } ,
You can’t perform that action at this time.
0 commit comments