diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-08-25 17:06:00 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-09-06 19:19:54 +0200 |
| commit | 2417386fd081a58dee26caf089bf707fbab47a66 (patch) | |
| tree | f82eb609a399131f4b40f35e6c93053737c488d7 | |
| parent | 6c3db60d8eb308cd92d4416ba962eedd34e3fab0 (diff) | |
| download | orm-2417386fd081a58dee26caf089bf707fbab47a66.tar.gz orm-2417386fd081a58dee26caf089bf707fbab47a66.zip | |
add custom http request timeout
| -rw-r--r-- | api.js | 2 |
1 files changed, 2 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 }; |
