diff --git a/CHANGELOG.md b/CHANGELOG.md index d310bd5..b626c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ -## [1.3.1-next.1](https://github.com/hirosystems/token-metadata-api/compare/v1.3.0...v1.3.1-next.1) (2026-01-06) +## [1.3.2](https://github.com/hirosystems/token-metadata-api/compare/v1.3.1...v1.3.2) (2025-10-02) + + +### Bug Fixes + +* force close db connection after a configurable timeout ([#321](https://github.com/hirosystems/token-metadata-api/issues/321)) ([2b02e81](https://github.com/hirosystems/token-metadata-api/commit/2b02e81095e10584be0649b749af4d15dd43337e)) + +## [1.3.1](https://github.com/hirosystems/token-metadata-api/compare/v1.3.0...v1.3.1) (2025-10-02) + ### Bug Fixes diff --git a/src/env.ts b/src/env.ts index 2b16d09..653d3f8 100644 --- a/src/env.ts +++ b/src/env.ts @@ -62,6 +62,7 @@ const schema = Type.Object({ PG_CONNECTION_POOL_MAX: Type.Number({ default: 10 }), PG_IDLE_TIMEOUT: Type.Number({ default: 30 }), PG_MAX_LIFETIME: Type.Number({ default: 60 }), + PG_CLOSE_TIMEOUT: Type.Number({ default: 10 }), STACKS_NODE_RPC_HOST: Type.String(), STACKS_NODE_RPC_PORT: Type.Number({ minimum: 0, maximum: 65535 }), diff --git a/src/index.ts b/src/index.ts index 66d36b9..eaf8ae7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -102,7 +102,7 @@ async function initApp() { name: 'DB', forceKillable: false, handler: async () => { - await db.close(); + await db.close({ timeout: ENV.PG_CLOSE_TIMEOUT }); }, }); }