Skip to content

Commit a74a9ed

Browse files
committed
f
1 parent 33e7910 commit a74a9ed

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Valkey / Redis client (support [redis protocol](https://redis.io/docs/latest/dev
2323
## Install
2424

2525
```bash
26-
npm i egg-redis
26+
npm i @eggjs/redis
2727
```
2828

2929
Valkey / Redis Plugin for egg, support egg application access to Valkey / Redis Service.

src/lib/redis.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ function createClient(options: RedisClusterOptions | RedisClientOptions, app: Eg
4141
`[@eggjs/redis] 'host: ${sentinel.host}', 'port: ${sentinel.port}' are required on config`);
4242
});
4343

44+
const mask = config.password ? '***' : config.password;
4445
assert(config.name && config.password !== undefined && config.db !== undefined,
45-
`[@eggjs/redis] 'name of master: ${config.name}', 'password: ${config.password}', 'db: ${config.db}' are required on config`);
46+
`[@eggjs/redis] 'name of master: ${config.name}', 'password: ${mask}', 'db: ${config.db}' are required on config`);
4647

4748
app.coreLogger.info('[@eggjs/redis] sentinel connecting start');
4849
client = new RedisClass(config as any);
4950
} else {
5051
const config = options as RedisClientOptions;
52+
const mask = config.password ? '***' : config.password;
5153
assert((config.host && config.port && config.password !== undefined && config.db !== undefined) || config.path,
52-
`[@eggjs/redis] 'host: ${config.host}', 'port: ${config.port}', 'password: ${config.password}', 'db: ${config.db}' or 'path:${config.path}' are required on config`);
54+
`[@eggjs/redis] 'host: ${config.host}', 'port: ${config.port}', 'password: ${mask}', 'db: ${config.db}' or 'path:${config.path}' are required on config`);
5355
if (config.host) {
5456
app.coreLogger.info('[@eggjs/redis] server connecting redis://:***@%s:%s/%s',
5557
config.host, config.port, config.db);

0 commit comments

Comments
 (0)