-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeout.js
39 lines (34 loc) · 1.14 KB
/
timeout.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* eslint-disable linebreak-style */
/* eslint-disable no-console */
// Duration that code & access token expire.
const timeoutInSeconds = parseInt(process.env.FORDSIM_TIMEOUT, 10) || 20 * 60;
const commandTimeoutInSeconds = parseInt(process.env.FORDSIM_CMDTIMEOUT, 10) || 120;
console.log(`timeout for code and access tokens set to ${timeoutInSeconds} seconds.`);
console.log(`timeout for commandIds set to ${commandTimeoutInSeconds} seconds.`);
/**
* Gets the number of seconds an access token is good for.
*
* @returns number of seconds until access token times out.
*/
function getAccessTokenTimeout() {
return timeoutInSeconds;
}
/**
* Gets the number of seconds the oauth code is good for.
*
* @returns number of seconds until oath code times out.
*/
function getCodeTimeout() {
return timeoutInSeconds;
}
/**
* Gets the number of seconds a commandId is good for.
*
* @returns integer. number of seconds the commandId is good for.
*/
function getCommandTimeout() {
return commandTimeoutInSeconds;
}
exports.getAccessTokenTimeout = getAccessTokenTimeout;
exports.getCodeTimeout = getCodeTimeout;
exports.getCommandTimeout = getCommandTimeout;