@azteam/redis-async 1.0.86 → 1.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Provider.js +5 -1
- package/package.json +2 -2
- package/src/Provider.js +5 -1
package/lib/Provider.js
CHANGED
|
@@ -36,7 +36,11 @@ var Provider = /*#__PURE__*/function () {
|
|
|
36
36
|
value: function getConnection() {
|
|
37
37
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'main';
|
|
38
38
|
if (!this.connections[name]) {
|
|
39
|
-
|
|
39
|
+
if (this.configs[name]) {
|
|
40
|
+
this.connections[name] = new _RedisAsync["default"](this.configs[name]);
|
|
41
|
+
} else {
|
|
42
|
+
return this.getConnection('main');
|
|
43
|
+
}
|
|
40
44
|
}
|
|
41
45
|
return this.connections[name];
|
|
42
46
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azteam/redis-async",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.88",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"toda",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build": "babel src --delete-dir-on-start -d lib"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@azteam/util": "1.0.
|
|
19
|
+
"@azteam/util": "1.0.36",
|
|
20
20
|
"redis": "4.0.6"
|
|
21
21
|
}
|
|
22
22
|
}
|
package/src/Provider.js
CHANGED
|
@@ -16,7 +16,11 @@ class Provider {
|
|
|
16
16
|
|
|
17
17
|
getConnection(name = 'main') {
|
|
18
18
|
if (!this.connections[name]) {
|
|
19
|
-
|
|
19
|
+
if (this.configs[name]) {
|
|
20
|
+
this.connections[name] = new RedisAsync(this.configs[name]);
|
|
21
|
+
} else {
|
|
22
|
+
return this.getConnection('main');
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
25
|
return this.connections[name];
|
|
22
26
|
}
|