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 =
25
25
export const GENERATE_TYPES_INCLUDED_SCHEMAS =
26
26
GENERATE_TYPES && process . argv [ 5 ] === '--include-schemas' ? process . argv [ 6 ] ?. split ( ',' ) ?? [ ] : [ ]
27
27
28
+ export const CONNECTIONS_CACHE_SIZE = Number ( process . env . PG_META_CONNECTIONS_CACHE_SIZE || '100' )
28
29
export const DEFAULT_POOL_CONFIG = { max : 1 , connectionTimeoutMillis : PG_CONN_TIMEOUT_SECS * 1000 }
29
30
export const PG_META_REQ_HEADER = process . env . PG_META_REQ_HEADER || 'request-id'
Original file line number Diff line number Diff line change 1
1
import LruCache from 'lru-cache'
2
2
import PostgresMeta from '../lib/PostgresMeta.js'
3
- import { DEFAULT_POOL_CONFIG } from './constants.js'
3
+ import { CONNECTIONS_CACHE_SIZE , DEFAULT_POOL_CONFIG } from './constants.js'
4
4
5
5
const cache = new LruCache < string , PostgresMeta > ( {
6
- max : 100 ,
6
+ max : CONNECTIONS_CACHE_SIZE ,
7
7
dispose : async ( value ) => {
8
8
await value . end ( )
9
9
} ,
You can’t perform that action at this time.
0 commit comments