Skip to content

Commit

Permalink
chore: const default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Drukh committed Nov 20, 2016
1 parent 8624868 commit 4e85bc6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var config = require('snyk-config')(__dirname + '/..');

var DEFAULT_TIMEOUT = 5 * 60; // in seconds

// allow user config override of the api end point
var endpoint = require('./user-config').get('endpoint');
if (endpoint) {
Expand All @@ -11,12 +13,12 @@ if (!config.org && org) {
config.org = org;
}

// default request timeout is 300 seconds
// client request timeout
// to change, set this config key to the desired value in seconds
// invalid (non-numeric) value will fallback to the default 5 min
// invalid (non-numeric) value will fallback to the default
var timeout = require('./user-config').get('timeout');
if (!config.timeout) {
config.timeout = +timeout ? +timeout : 5 * 60;
config.timeout = +timeout ? +timeout : DEFAULT_TIMEOUT;
}

// this is a bit of an assumption that our web site origin is the same
Expand Down

0 comments on commit 4e85bc6

Please sign in to comment.