connect-redis
Advanced tools
Comparing version 7.0.0 to 7.0.1
{ | ||
"name": "connect-redis", | ||
"description": "Redis session store for Connect", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -49,2 +49,5 @@ "contributors": [ | ||
}, | ||
"peerDependencies": { | ||
"express-session": ">=1" | ||
}, | ||
"engines": { | ||
@@ -51,0 +54,0 @@ "node": ">=16" |
@@ -127,27 +127,3 @@ ![Build Status](https://github.com/tj/connect-redis/workflows/build/badge.svg?branch=master) [![npm](https://img.shields.io/npm/v/connect-redis.svg)](https://npmjs.com/package/connect-redis) [![code-style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://gitter.im/jlongster/prettier) ![Downloads](https://img.shields.io/npm/dm/connect-redis.svg) | ||
## FAQ | ||
#### How to log Redis errors? | ||
```js | ||
client.on("error", console.error) | ||
``` | ||
#### How do I handle lost connections to Redis? | ||
By default, the Redis client will [auto-reconnect](https://github.com/mranney/node_redis#overloading) on lost connections. But requests may come in during that time. In Express, one way you can handle this scenario is including a "session check": | ||
```js | ||
app.use(session(/* setup session here */)) | ||
app.use(function (req, res, next) { | ||
if (!req.session) { | ||
return next(new Error("oh no")) // handle error | ||
} | ||
next() // otherwise continue | ||
}) | ||
``` | ||
If you want to retry, here is [another option](https://github.com/expressjs/session/issues/99#issuecomment-63853989). | ||
[1]: https://github.com/NodeRedis/node-redis | ||
[2]: https://github.com/luin/ioredis |
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
42824
1
129