Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'forever' as an option to RequestClient request method. #315

Merged
merged 1 commit into from Jan 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/base/RequestClient.js
Expand Up @@ -20,6 +20,7 @@ var RequestClient = function() {};
* @param {object} [opts.data] - The request data
* @param {int} [opts.timeout=30000] - The request timeout in milliseconds
* @param {boolean} [opts.allowRedirects] - Should the client follow redirects
* @param {boolean} [opts.forever] - Set to true to use the forever-agent
*/
RequestClient.prototype.request = function(opts) {
opts = opts || {};
Expand All @@ -44,7 +45,7 @@ RequestClient.prototype.request = function(opts) {
url: opts.uri,
method: opts.method,
headers: opts.headers,
forever: true,
forever: opts.forever === false ? false : true,
};

if (!_.isNull(opts.data)) {
Expand Down