Skip to content

Commit f27cb2b

Browse files
committed
released 1.5.3 with redis connection fixes
1 parent b1b19f5 commit f27cb2b

File tree

5 files changed

+3540
-6
lines changed

5 files changed

+3540
-6
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ node_js:
55
- 8.0.0
66
- 10.0.0
77
- 11.0.0
8+
- 12.0.0
89
after_success: npm run coverage

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ Special thanks to all those that use this library and report issues, but especia
269269

270270
### Bugfixes, tweaks, documentation, etc.
271271

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

274274
### Changelog
275275

276+
- **v1.5.3** - multiple fixes: Redis should be connected before using (thanks @guybrush)
276277
- **v1.5.2** - multiple fixes: Buffer deprecation and \_headers deprecation, { trackPerformance: false } by default per discussion (sorry semver...)
277278
- **v1.5.1** - adds { trackPerformance } option to enable/disable performance tracking (thanks @fernandolguevara)
278279
- **v1.5.0** - exposes apicache.getPerformance() for per-route cache metrics (@killdash9 continues to deliver)

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apicache",
3-
"version": "1.5.2",
3+
"version": "1.5.3",
44
"scripts": {
55
"lint": "eslint .",
66
"pretest": "npm run lint",
@@ -10,7 +10,7 @@
1010
"prepublish": "npm run test"
1111
},
1212
"engines": {
13-
"node": ">=6.2.0"
13+
"node": ">=6.2.0 <13"
1414
},
1515
"description": "An ultra-simplified API response caching middleware for Express/Node using plain-english durations.",
1616
"main": "./src/apicache.js",
@@ -44,13 +44,13 @@
4444
"express": "^4.17.1",
4545
"fakeredis": "^2.0.0",
4646
"husky": "^3.0.4",
47-
"mocha": "^5.2.0",
47+
"mocha": "^7.0.0",
4848
"nyc": "^13.3.0",
4949
"prettier": "^1.18.2",
5050
"pretty-quick": "^1.11.1",
5151
"restify": "^7.7.0",
5252
"restify-etag-cache": "^1.0.12",
53-
"supertest": "^3.4.2"
53+
"supertest": "^4.0.2"
5454
},
5555
"dependencies": {},
5656
"husky": {

src/apicache.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function ApiCache() {
132132
var redis = globalOptions.redisClient
133133
var expireCallback = globalOptions.events.expire
134134

135-
if (redis) {
135+
if (redis && redis.connected) {
136136
try {
137137
redis.hset(key, 'response', JSON.stringify(value))
138138
redis.hset(key, 'duration', duration)

0 commit comments

Comments
 (0)