mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Set timeout for HTTP requests.
This commit is contained in:
@@ -12,6 +12,7 @@ var auth = require('../meteor-services/auth.js');
|
||||
var config = require('../meteor-services/config.js');
|
||||
var release = require('../packaging/release.js');
|
||||
var Console = require('../console/console.js').Console;
|
||||
var timeoutScaleFactor = require('./utils.js').timeoutScaleFactor;
|
||||
|
||||
|
||||
// Helper that tracks bytes written to a writable
|
||||
@@ -244,6 +245,12 @@ _.extend(exports, {
|
||||
options.proxy = proxy;
|
||||
}
|
||||
|
||||
if (! options.timeout) {
|
||||
// 15 seconds for timeout between initial response headers and data,
|
||||
// and between chunks of data while reading the rest of the response.
|
||||
options.timeout = 15000 * timeoutScaleFactor;
|
||||
}
|
||||
|
||||
// request is the most heavy-weight of the tool's npm dependencies; don't
|
||||
// require it until we definitely need it.
|
||||
Console.debug("Doing HTTP request: ", options.method || 'GET', options.url);
|
||||
|
||||
Reference in New Issue
Block a user