Skip to content

Commit

Permalink
Merge pull request #46 from node-modules/timeout-string
Browse files Browse the repository at this point in the history
humanize timeout
  • Loading branch information
fengmk2 committed Nov 15, 2014
2 parents ece3546 + 98b8ab3 commit 6ca31c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/urllib.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var digestAuthHeader = require('digest-header');
var typer = require('media-typer');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var ms = require('humanize-ms');

var _Promise;
var _iconv;
Expand All @@ -45,7 +46,8 @@ exports.httpsAgent.maxSockets = 1000;
* @type {Number}
* @const
*/
exports.TIMEOUT = 5000;

exports.TIMEOUT = ms('5s');

var REQUEST_ID = 0;

Expand Down Expand Up @@ -559,7 +561,7 @@ exports.requestWithCallback = function (url, args, callback) {
req.abort();
};

var timeout = args.timeout;
var timeout = ms(args.timeout);

timer = setTimeout(function () {
timer = null;
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"debug": "~2.1.0",
"default-user-agent": "~0.0.1",
"digest-header": "~0.0.1",
"humanize-ms": "~1.0.0",
"iconv-lite": "~0.4.4",
"media-typer": "~0.3.0",
"native-or-bluebird": "~1.1.2"
Expand All @@ -41,12 +42,12 @@
"bluebird": "*",
"co": "*",
"contributors": "*",
"formstream": "~0.0.8",
"formstream": "~1.0.0",
"istanbul": "*",
"jshint": "*",
"mocha": "*",
"pedding": "*",
"should": "~4.0.4",
"pedding": "~1.0.0",
"should": "~4.3.0",
"should-http": "*"
},
"engines": {
Expand Down

0 comments on commit 6ca31c8

Please sign in to comment.