mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #3545 from omnivore-app/fix/pg-pool-connection-timeout
fix/pg pool connection timeout
This commit is contained in:
commit
e386c35ea2
2 changed files with 3 additions and 18 deletions
|
|
@ -16,9 +16,11 @@ export const appDataSource = new DataSource({
|
|||
subscribers: [__dirname + '/events/**/*{.js,.ts}'],
|
||||
namingStrategy: new SnakeNamingStrategy(),
|
||||
logger: new CustomTypeOrmLogger(['query', 'info']),
|
||||
connectTimeoutMS: 40000, // 40 seconds
|
||||
connectTimeoutMS: 10000, // 10 seconds
|
||||
maxQueryExecutionTime: 10000, // 10 seconds
|
||||
extra: {
|
||||
options: process.env.PG_EXTRA_OPTIONS,
|
||||
max: env.pg.pool.max,
|
||||
idleTimeoutMillis: 10000, // 10 seconds
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -140,23 +140,6 @@ const main = async () => {
|
|||
mq: env.redis.mq,
|
||||
})
|
||||
|
||||
appDataSource.setOptions({
|
||||
type: 'postgres',
|
||||
host: env.pg.host,
|
||||
port: env.pg.port,
|
||||
schema: 'omnivore',
|
||||
username: env.pg.userName,
|
||||
password: env.pg.password,
|
||||
database: env.pg.dbName,
|
||||
logging: ['query', 'info'],
|
||||
entities: [__dirname + '/entity/**/*{.js,.ts}'],
|
||||
subscribers: [__dirname + '/events/**/*{.js,.ts}'],
|
||||
namingStrategy: new SnakeNamingStrategy(),
|
||||
logger: new CustomTypeOrmLogger(['query', 'info']),
|
||||
connectTimeoutMS: 40000, // 40 seconds
|
||||
maxQueryExecutionTime: 10000, // 10 seconds
|
||||
})
|
||||
|
||||
// respond healthy to auto-scaler.
|
||||
app.get('/_ah/health', (req, res) => res.sendStatus(200))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue