Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit ae8cea3

Browse files
committed
fix: remove default timeout from http rpc calls
Do not specify a default timeout - since requests are now abortable, killing the connection (e.g. ctrl+c) will tear down long-lived resources on the node. fixes: #3161
1 parent 4565a3e commit ae8cea3

File tree

1 file changed

+2
-2
lines changed
  • packages/ipfs-http-client/src/lib

1 file changed

+2
-2
lines changed

packages/ipfs-http-client/src/lib/core.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const parseTimeout = (value) => {
9696
* @prop {number} [port]
9797
* @prop {string} [protocol]
9898
* @prop {Headers|Record<string, string>} [headers] - Request headers.
99-
* @prop {number|string} [timeout] - Amount of time until request should timeout in ms or humand readable. https://www.npmjs.com/package/parse-duration for valid string values.
99+
* @prop {number|string} [timeout] - Amount of time until request should timeout in ms or human readable. https://www.npmjs.com/package/parse-duration for valid string values.
100100
* @prop {string} [apiPath] - Path to the API.
101101
* @prop {URL|string} [url] - Full API URL.
102102
*/
@@ -110,7 +110,7 @@ class Client extends HTTP {
110110
/** @type {ClientOptions} */
111111
const opts = normalizeInput(options)
112112
super({
113-
timeout: parseTimeout(opts.timeout) || 60000 * 20,
113+
timeout: parseTimeout(opts.timeout),
114114
headers: opts.headers,
115115
base: normalizeInput(opts.url).toString(),
116116
handleError: errorHandler,

0 commit comments

Comments
 (0)