File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { getServiceChildLogger } from '@crowd/logging'
22import { Edition } from '@crowd/types'
33import { API_CONFIG , IS_TEST_ENV , SEGMENT_CONFIG } from '../conf'
4- import getTenatUser from './trackHelper'
5- import addProductData , { CROWD_ANALYTICS_PLATORM_NAME } from './addProductDataToCrowdTenant'
64import SequelizeRepository from '../database/repositories/sequelizeRepository'
5+ import { CROWD_ANALYTICS_PLATORM_NAME } from './addProductDataToCrowdTenant'
6+ import getTenatUser from './trackHelper'
77
88const log = getServiceChildLogger ( 'segment' )
99
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ setImmediate(async () => {
2020
2121 const sqsClient = getSqsClient ( SQS_CONFIG ( ) )
2222
23- const dbConnection = await getDbConnection ( DB_CONFIG ( ) , 3 )
23+ const dbConnection = await getDbConnection ( DB_CONFIG ( ) , 3 , 0 )
2424
2525 app . use ( ( req , res , next ) => {
2626 // Groups.io doesn't send a content-type header,
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ let dbConnection: DbConnection | undefined
4747export const getDbConnection = async (
4848 config : IDatabaseConfig ,
4949 maxPoolSize ?: number ,
50+ idleTimeoutMillis ?: number ,
5051) : Promise < DbConnection > => {
5152 if ( dbConnection ) {
5253 return dbConnection
@@ -62,6 +63,7 @@ export const getDbConnection = async (
6263 dbConnection = dbInstance ( {
6364 ...config ,
6465 max : maxPoolSize || 20 ,
66+ idleTimeoutMillis : idleTimeoutMillis !== undefined ? idleTimeoutMillis : 10000 ,
6567 // query_timeout: 30000,
6668 application_name : process . env . SERVICE || 'unknown-app' ,
6769 } )
You can’t perform that action at this time.
0 commit comments