Skip to content

Commit

Permalink
Fix timeout error on nodejs 19/nodejs 20
Browse files Browse the repository at this point in the history
This somehow related to use of agent and bug in nodejs nodejs/node#47137
  • Loading branch information
olexiyb committed Apr 26, 2023
1 parent 8ac409e commit 2181f96
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 2181f96

Please sign in to comment.