refactor: always debug log github get requests

This commit is contained in:
Rhys Arkins 2018-01-19 12:00:26 +01:00
parent 285a59b085
commit 3e1d8474a9

View file

@ -11,13 +11,11 @@ function sleep(ms) {
async function get(path, opts, retries = 5) { async function get(path, opts, retries = 5) {
const method = opts && opts.method ? opts.method : 'get'; const method = opts && opts.method ? opts.method : 'get';
logger.debug({ retries }, `${method.toUpperCase()} ${path}`);
if (method === 'get' && cache[path]) { if (method === 'get' && cache[path]) {
logger.debug({ path }, 'Returning cached result'); logger.debug({ path }, 'Returning cached result');
return cache[path]; return cache[path];
} }
if (retries === 5) {
logger.debug(`${method.toUpperCase()} ${path}`);
}
try { try {
if (appMode) { if (appMode) {
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */