Skip to content

Commit

Permalink
released 1.5.3 with redis connection fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kwhitley committed Jan 10, 2020
1 parent b1b19f5 commit f27cb2b
Show file tree
Hide file tree
Showing 5 changed files with 3,540 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ node_js:
- 8.0.0
- 10.0.0
- 11.0.0
- 12.0.0
after_success: npm run coverage
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,11 @@ Special thanks to all those that use this library and report issues, but especia

### Bugfixes, tweaks, documentation, etc.

- @Amhri, @Webcascade, @conmarap, @cjfurelid, @scambier, @lukechilds, @Red-Lv, @gesposito, @viebel, @RowanMeara, @GoingFast, @luin, @keithws, @daveross, @apascal
- @Amhri, @Webcascade, @conmarap, @cjfurelid, @scambier, @lukechilds, @Red-Lv, @gesposito, @viebel, @RowanMeara, @GoingFast, @luin, @keithws, @daveross, @apascal, @guybrush

### Changelog

- **v1.5.3** - multiple fixes: Redis should be connected before using (thanks @guybrush)
- **v1.5.2** - multiple fixes: Buffer deprecation and \_headers deprecation, { trackPerformance: false } by default per discussion (sorry semver...)
- **v1.5.1** - adds { trackPerformance } option to enable/disable performance tracking (thanks @fernandolguevara)
- **v1.5.0** - exposes apicache.getPerformance() for per-route cache metrics (@killdash9 continues to deliver)
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apicache",
"version": "1.5.2",
"version": "1.5.3",
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
Expand All @@ -10,7 +10,7 @@
"prepublish": "npm run test"
},
"engines": {
"node": ">=6.2.0"
"node": ">=6.2.0 <13"
},
"description": "An ultra-simplified API response caching middleware for Express/Node using plain-english durations.",
"main": "./src/apicache.js",
Expand Down Expand Up @@ -44,13 +44,13 @@
"express": "^4.17.1",
"fakeredis": "^2.0.0",
"husky": "^3.0.4",
"mocha": "^5.2.0",
"mocha": "^7.0.0",
"nyc": "^13.3.0",
"prettier": "^1.18.2",
"pretty-quick": "^1.11.1",
"restify": "^7.7.0",
"restify-etag-cache": "^1.0.12",
"supertest": "^3.4.2"
"supertest": "^4.0.2"
},
"dependencies": {},
"husky": {
Expand Down
2 changes: 1 addition & 1 deletion src/apicache.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function ApiCache() {
var redis = globalOptions.redisClient
var expireCallback = globalOptions.events.expire

if (redis) {
if (redis && redis.connected) {
try {
redis.hset(key, 'response', JSON.stringify(value))
redis.hset(key, 'duration', duration)
Expand Down
Loading

0 comments on commit f27cb2b

Please sign in to comment.