@azteam/rabbitmq-async 1.0.183 → 1.0.184
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 +1 -1
- 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 _RabbitMQAsync["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
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 RabbitMQAsync(this.configs[name]);
|
|
21
|
+
} else {
|
|
22
|
+
return this.getConnection('main');
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
25
|
return this.connections[name];
|
|
22
26
|
}
|