Skip to content

Commit c586bc7

Browse files
authored
Merge branch 'master' into fix/add-graceful-exit-logging
2 parents 601ebf4 + 3069b84 commit c586bc7

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/release.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,8 @@ jobs:
8787
username: ${{ github.actor }}
8888
password: ${{ secrets.GITHUB_TOKEN }}
8989

90-
- uses: docker/build-push-action@v5
90+
- uses: docker/build-push-action@v6
9191
with:
9292
push: true
9393
platforms: linux/amd64,linux/arm64
9494
tags: ${{ steps.meta.outputs.tags }}
95-
cache-from: type=gha
96-
cache-to: type=gha,mode=max

src/server/constants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const PG_META_DB_PASSWORD = (await getSecret('PG_META_DB_PASSWORD')) || 'postgre
1616
const PG_META_DB_SSL_MODE = process.env.PG_META_DB_SSL_MODE || 'disable'
1717

1818
const PG_CONN_TIMEOUT_SECS = Number(process.env.PG_CONN_TIMEOUT_SECS || 15)
19+
const PG_QUERY_TIMEOUT_SECS = Number(process.env.PG_QUERY_TIMEOUT_SECS || 55)
1920

2021
export let PG_CONNECTION = process.env.PG_META_DB_URL
2122
if (!PG_CONNECTION) {
@@ -58,6 +59,7 @@ export const PG_META_MAX_RESULT_SIZE = process.env.PG_META_MAX_RESULT_SIZE_MB
5859
export const DEFAULT_POOL_CONFIG: PoolConfig = {
5960
max: 1,
6061
connectionTimeoutMillis: PG_CONN_TIMEOUT_SECS * 1000,
62+
query_timeout: PG_QUERY_TIMEOUT_SECS * 1000,
6163
ssl: PG_META_DB_SSL_ROOT_CERT ? { ca: PG_META_DB_SSL_ROOT_CERT } : undefined,
6264
application_name: `postgres-meta ${pkg.version}`,
6365
maxResultSize: PG_META_MAX_RESULT_SIZE,

src/server/utils.ts

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export function translateErrorToResponseCode(
2929
return 504
3030
} else if (error.message === 'sorry, too many clients already') {
3131
return 503
32+
} else if (error.message === 'Query read timeout') {
33+
return 408
3234
}
3335
return defaultResponseCode
3436
}

0 commit comments

Comments
 (0)