Скорректировал package.json в части команд запуска. Убрал еще одну лишнюю переменную с количеством pg соединений. Default value у pg pool = 10, чего должно хватать

This commit is contained in:
Первов Артем
2026-06-21 02:51:32 +03:00
parent 3346e572d2
commit 59e978f8cd
5 changed files with 2 additions and 8 deletions

View File

@@ -5,8 +5,5 @@ CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
# Optional. When set, POST /ingest requires x-api-key: <value>. # Optional. When set, POST /ingest requires x-api-key: <value>.
INGEST_API_KEY= INGEST_API_KEY=
# Pool sizing for node-postgres.
PG_POOL_MAX=20
# Poll interval for GET /current/events SSE snapshots. # Poll interval for GET /current/events SSE snapshots.
CURRENT_EVENTS_POLL_MS=1000 CURRENT_EVENTS_POLL_MS=1000

View File

@@ -2,5 +2,4 @@ PORT=3101
DATABASE_URL=postgres://greact:pG3526l4@194.36.208.86:5433/cloud DATABASE_URL=postgres://greact:pG3526l4@194.36.208.86:5433/cloud
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173 CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
INGEST_API_KEY= INGEST_API_KEY=
PG_POOL_MAX=20
CURRENT_EVENTS_POLL_MS=1000 CURRENT_EVENTS_POLL_MS=1000

View File

@@ -9,7 +9,6 @@ services:
DATABASE_URL: ${DATABASE_URL} DATABASE_URL: ${DATABASE_URL}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS} CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS}
INGEST_API_KEY: ${INGEST_API_KEY} INGEST_API_KEY: ${INGEST_API_KEY}
PG_POOL_MAX: ${PG_POOL_MAX}
CURRENT_EVENTS_POLL_MS: ${CURRENT_EVENTS_POLL_MS} CURRENT_EVENTS_POLL_MS: ${CURRENT_EVENTS_POLL_MS}
ports: ports:
- "${PORT}:${PORT}" - "${PORT}:${PORT}"

View File

@@ -6,8 +6,8 @@
"license": "PERSONAL", "license": "PERSONAL",
"scripts": { "scripts": {
"build": "nest build", "build": "nest build",
"start": "node --env-file=.env ./node_modules/@nestjs/cli/bin/nest.js start", "start": "nest start --exec \"node --env-file=.env\"",
"start:dev": "node --env-file=.env ./node_modules/@nestjs/cli/bin/nest.js start --watch", "start:dev": "nest start --watch --exec \"node --env-file=.env\"",
"start:prod": "node dist/main.js", "start:prod": "node dist/main.js",
"lint": "eslint \"src/**/*.ts\"", "lint": "eslint \"src/**/*.ts\"",
"test": "jest --runInBand" "test": "jest --runInBand"

View File

@@ -15,7 +15,6 @@ export class DbService implements OnModuleInit, OnModuleDestroy {
async onModuleInit(): Promise<void> { async onModuleInit(): Promise<void> {
this.pool = new Pool({ this.pool = new Pool({
connectionString: process.env.DATABASE_URL, connectionString: process.env.DATABASE_URL,
max: Number(process.env.PG_POOL_MAX),
idleTimeoutMillis: 30_000, idleTimeoutMillis: 30_000,
connectionTimeoutMillis: 5_000, connectionTimeoutMillis: 5_000,
statement_timeout: 60_000, statement_timeout: 60_000,