Skip to content
Snippets Groups Projects
Commit bf3f0862 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor: clear stats only if more than one request

parent 4539487d
No related branches found
No related tags found
No related merge requests found
...@@ -188,7 +188,7 @@ get.reset = function reset() { ...@@ -188,7 +188,7 @@ get.reset = function reset() {
cache = null; cache = null;
cache = {}; cache = {};
// istanbul ignore if // istanbul ignore if
if (stats.requests && stats.requests.length) { if (stats.requests && stats.requests.length > 1) {
logger.info( logger.info(
{ {
rateLimit: stats.rateLimit, rateLimit: stats.rateLimit,
...@@ -199,8 +199,8 @@ get.reset = function reset() { ...@@ -199,8 +199,8 @@ get.reset = function reset() {
); );
stats.requests.sort(); stats.requests.sort();
logger.debug({ requests: stats.requests }, 'All requests'); logger.debug({ requests: stats.requests }, 'All requests');
}
stats = {}; stats = {};
}
}; };
module.exports = get; module.exports = get;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment