Skip to content

Commit 0ff07d0

Browse files
committed
refactor: move env check to default param
1 parent 0870468 commit 0ff07d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class Api {
101101
* @param {string=} prefix
102102
* @param {string=} url
103103
*/
104-
constructor (store, prefix = 'y', url) {
104+
constructor (store, prefix = 'y', url = env.ensureConf('ysr-redis')) {
105105
this.store = store
106106
this.prefix = prefix
107107
this.consumername = random.uuidv4()
@@ -118,7 +118,7 @@ export class Api {
118118
this.redisWorkerGroupName = this.prefix + ':worker'
119119
this._destroyed = false
120120
this.redis = redis.createClient({
121-
url: url || env.ensureConf('ysr-redis'),
121+
url,
122122
// scripting: https://github.com/redis/node-redis/#lua-scripts
123123
scripts: {
124124
addMessage: redis.defineScript({

0 commit comments

Comments
 (0)