simple-node-framework
Advanced tools
Comparing version 6.0.29 to 6.0.30
const Loggable = require('./base/loggable'); | ||
const config = require('./config'); | ||
const redis = require('./redis').instance; | ||
const ProcessTimer = require('././util/process-timer'); | ||
const errorHandler = require('./error').instance; | ||
@@ -17,2 +18,3 @@ const objectHash = require('object-hash'); | ||
this.errorHandler = errorHandler; | ||
this.timer = new ProcessTimer(); | ||
} | ||
@@ -55,2 +57,4 @@ | ||
const timer = this.timer.start(); | ||
return this.redis | ||
@@ -60,3 +64,5 @@ .get(key) | ||
(cache) => { | ||
if(this.config.cache.logHits) this.log.debug(`Hit from cache [${key}]`); | ||
const interval = this.timer.writeLog(timer, 'loadResponse'); | ||
if(this.config.cache.logHits) | ||
this.log.debug(`Hit from cache [${key}] [${interval.milliseconds}]`, { natural: { responseTime: interval.milliseconds } }); | ||
res.status(cache.status).set(cache.headers).send(cache.body); | ||
@@ -63,0 +69,0 @@ }, |
{ | ||
"name": "simple-node-framework", | ||
"version": "6.0.29", | ||
"version": "6.0.30", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "basic", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128432
2057