Skip to content

Commit

Permalink
Fix timeout error on nodejs 19/nodejs 20 (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
olexiyb authored Apr 26, 2023
1 parent 8ac409e commit 6f1b81e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/connection/adapter/base_http_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export abstract class BaseHttpAdapter implements Connection {
const start = Date.now()

const request = this.createClientRequest(params.url, params)

request.once('socket', (socket) => {
socket.setTimeout(this.config.request_timeout)
})
function onError(err: Error): void {
removeRequestListeners()
reject(err)
Expand Down

0 comments on commit 6f1b81e

Please sign in to comment.