egg-redis
Advanced tools
Comparing version 2.2.0 to 2.3.0
2.3.0 / 2018-12-18 | ||
================== | ||
* feat: redis sentinel config support (#26) | ||
* deps: add @types/ioredis to deps (#25) | ||
2.2.0 / 2018-12-04 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -23,2 +23,15 @@ 'use strict'; | ||
client = new Redis.Cluster(config.nodes, config); | ||
} else if (config.sentinels) { | ||
assert(config.sentinels && config.sentinels.length !== 0, '[egg-redis] sentinels configuration is required when use redis sentinel'); | ||
config.sentinels.forEach(sentinel => { | ||
assert(sentinel.host && sentinel.port, | ||
`[egg-redis] 'host: ${sentinel.host}', 'port: ${sentinel.port}' are required on config`); | ||
}); | ||
assert(config.name && config.password !== undefined && config.db !== undefined, | ||
`[egg-redis] 'name of master: ${config.name}', 'password: ${config.password}', 'db: ${config.db}' are required on config`); | ||
app.coreLogger.info('[egg-redis] sentinel connecting start'); | ||
client = new Redis(config); | ||
} else { | ||
@@ -25,0 +38,0 @@ assert(config.host && config.port && config.password !== undefined && config.db !== undefined, |
{ | ||
"name": "egg-redis", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Redis plugin for egg", | ||
@@ -24,6 +24,6 @@ "eggPlugin": { | ||
"dependencies": { | ||
"ioredis": "^3.2.2" | ||
"ioredis": "^3.2.2", | ||
"@types/ioredis": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/ioredis": "^4.0.1", | ||
"@types/node": "^10.9.4", | ||
@@ -30,0 +30,0 @@ "typescript": "^3.0.3", |
@@ -82,2 +82,18 @@ # egg-redis | ||
**Sentinel** | ||
```javascript | ||
config.redis = { | ||
client: { | ||
sentinels: [{ // Sentinel instances | ||
port: 26379, // Sentinel port | ||
host: '127.0.0.1', // Sentinel host | ||
}], | ||
name: 'mymaster', // Master name | ||
password: 'auth', | ||
db: 0 | ||
}, | ||
} | ||
``` | ||
**No password** | ||
@@ -84,0 +100,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15113
11
140
229
2
1
+ Added@types/ioredis@^4.0.1
+ Added@types/ioredis@4.28.10(transitive)
+ Added@types/node@20.12.11(transitive)
+ Addedundici-types@5.26.5(transitive)