featureservice
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -5,5 +5,15 @@ # Change Log | ||
## [0.2.0] - 2015-08-06 | ||
### Added | ||
* Feature requests time out | ||
## Changed | ||
* Timeout set at 90 seconds | ||
## Fixed | ||
* Reference to non-existent functions | ||
## [0.1.0] - 2015-08-05 | ||
### Added | ||
* Requests time out after 5 minutes of inactivity by default | ||
* Feature service requests time out after 5 minutes of inactivity by default | ||
@@ -35,2 +45,3 @@ ### Changed | ||
[0.2.0]: https://github.com/chelm/featureservice/ompare/v0.1.0...v0.2.0 | ||
[0.1.0]: https://github.com/chelm/featureservice/ompare/v0.0.4...v0.1.0 | ||
@@ -37,0 +48,0 @@ [0.0.4]: https://github.com/chelm/featureservice/ompare/v0.0.3...v0.0.4 |
17
index.js
@@ -33,3 +33,3 @@ var queue = require('async').queue | ||
this.layer = options.layer || 0 | ||
this.timeOut = 5 * 60 * 1000 | ||
this.timeOut = 1.5 * 60 * 1000 | ||
@@ -385,2 +385,3 @@ // an async for requesting pages of data | ||
var uri = encodeURI(decodeURI(task.req)) | ||
var self = this | ||
try { | ||
@@ -393,2 +394,3 @@ var url_parts = urlUtils.parse(uri) | ||
hostname: url_parts.hostname, | ||
keepAlive: true, | ||
path: url_parts.path, | ||
@@ -445,2 +447,9 @@ headers: { | ||
req.setTimeout(self.timeOut, function () { | ||
// kill it immediately if a timeout occurs | ||
req.end() | ||
var err = JSON.stringify({message: 'The request timed out after ' + self.timeOut / 1000 + ' seconds.'}) | ||
catchErrors(task, err, uri, cb) | ||
}) | ||
// we need this error catch to handle ECONNRESET | ||
@@ -457,3 +466,3 @@ req.on('error', function (err) { | ||
// Catch any errors and either retry the request or fail it | ||
var catchErrors = function (task, e, url) { | ||
var catchErrors = function (task, e, url, cb) { | ||
if (task.retry && task.retry === 3) { | ||
@@ -468,3 +477,3 @@ try { | ||
} | ||
// immediately kill | ||
if (!task.retry) { | ||
@@ -479,3 +488,3 @@ task.retry = 1 | ||
setTimeout(function () { | ||
this.requestFeatures(task, cb) | ||
this._requestFeatures(task, cb) | ||
}.bind(this), task.retry * 1000) | ||
@@ -482,0 +491,0 @@ |
{ | ||
"name": "featureservice", | ||
"description": "a node module meant to extract every feature from an Esri geo-service thing", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"author": "Chris Helm", | ||
@@ -6,0 +6,0 @@ "contributors": "Daniel Fenton", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
194128
1263
5