diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-09-06 19:20:50 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-09-06 19:20:50 +0200 |
| commit | 9c2b01b6ddfbab25a2fc53b6204f17be2ada2133 (patch) | |
| tree | dc57715a552bb7b4b173adf4cef1674e454eeba4 /api.js | |
| parent | e9529ac4f7b7df38e61e6939ba74a0b3c28d7e62 (diff) | |
| parent | 4314507460f7826e7f29510ee816df102751e0eb (diff) | |
| download | orm-release/2.17.0.tar.gz orm-release/2.17.0.zip | |
Merge branch 'release/2.16.0' into release/2.17.0release/2.17.0
Diffstat (limited to 'api.js')
| -rw-r--r-- | api.js | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -9,6 +9,7 @@ const Promise = require("bluebird"), const MADGLORY_TOKEN = process.env.MADGLORY_TOKEN, MADGLORY_URL = process.env.MADGLORY_URL || "https://api.dc01.gamelockerapp.com", + API_TIMEOUT = process.env.API_TIMEOUT || 20, // seconds ERROR_LOG = process.env.ERROR_LOG || "./errors.json"; if (MADGLORY_TOKEN == undefined) throw "Need an API token"; @@ -31,6 +32,7 @@ module.exports.request = async (url, options, logger) => { gzip: true, time: true, forever: true, + timeout: API_TIMEOUT*1000, strictSSL: true, resolveWithFullResponse: true }; @@ -69,6 +71,7 @@ module.exports.request = async (url, options, logger) => { qs: options, status: response.statusCode, connection_start: response.timings.connect, + connection_first: response.timings.response, connection_end: response.timings.end, ratelimit_remaining: parseInt(response.headers["x-ratelimit-remaining"]) }); |
