Skip to content

Commit

Permalink
fix: Revert "fix: query timeout" (#777)
Browse files Browse the repository at this point in the history
This reverts commit e49ebcd.
  • Loading branch information
soedirgo authored Jun 12, 2024
1 parent 80bee30 commit a473298
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion src/server/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const GENERATE_TYPES_DETECT_ONE_TO_ONE_RELATIONSHIPS =

export const DEFAULT_POOL_CONFIG: PoolConfig = {
max: 1,
query_timeout: PG_CONN_TIMEOUT_SECS * 1000,
connectionTimeoutMillis: PG_CONN_TIMEOUT_SECS * 1000,
ssl: PG_META_DB_SSL_ROOT_CERT ? { ca: PG_META_DB_SSL_ROOT_CERT } : undefined,
}

Expand Down
15 changes: 0 additions & 15 deletions test/server/query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect, test } from 'vitest'
import { app } from './utils'
import { DEFAULT_POOL_CONFIG } from '../../src/server/constants'

test('query', async () => {
const res = await app.inject({
Expand Down Expand Up @@ -540,17 +539,3 @@ test('very big number', async () => {
]
`)
})

test('query timeout', async () => {
const defaultTimeout = DEFAULT_POOL_CONFIG.query_timeout
DEFAULT_POOL_CONFIG.query_timeout = 100

const res = await app.inject({
method: 'POST',
path: '/query',
payload: { query: "select pg_sleep_for('1 minute');" },
})
expect(res.json()?.error).toMatchInlineSnapshot(`"Query read timeout"`)

DEFAULT_POOL_CONFIG.query_timeout = defaultTimeout
})

0 comments on commit a473298

Please sign in to comment.