fetch-sparql-endpoint
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -36,3 +36,3 @@ "use strict"; | ||
}; | ||
this.timeout = args.timeout || 5000; | ||
this.timeout = args.timeout; | ||
} | ||
@@ -179,7 +179,10 @@ /** | ||
async handleFetchCall(url, init, options = {}) { | ||
const controller = new abort_controller_1.default(); | ||
init.signal = controller.signal; | ||
const id = setTimeout(() => controller.abort(), this.timeout); | ||
let timeoutId; | ||
if (this.timeout) { | ||
const controller = new abort_controller_1.default(); | ||
init.signal = controller.signal; | ||
timeoutId = setTimeout(() => controller.abort(), this.timeout); | ||
} | ||
const httpResponse = await (this.fetchCb || fetch)(url, init); | ||
clearTimeout(id); | ||
clearTimeout(timeoutId); | ||
let responseStream; | ||
@@ -186,0 +189,0 @@ // Handle response body |
{ | ||
"name": "fetch-sparql-endpoint", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "A simple, lightweight module to send queries to SPARQL endpoints and retrieve their results in a streaming fashion.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55002
466