@autofleet/rabbit 3.2.22-beta.3 → 3.2.22-beta.4
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/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/src/index.ts +4 -1
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ type newChannelOpts = {
|
|
|
42
42
|
type assertChannelOpts = {
|
|
43
43
|
channelName?: string;
|
|
44
44
|
force?: boolean;
|
|
45
|
-
connectionPurpose
|
|
45
|
+
connectionPurpose?: ConnectionPurpose;
|
|
46
46
|
};
|
|
47
47
|
declare class RabbitMq implements IAfRabbitMq {
|
|
48
48
|
static parseMsg(msg: any): any;
|
package/dist/index.js
CHANGED
|
@@ -508,6 +508,9 @@ class RabbitMq {
|
|
|
508
508
|
async isConnected() {
|
|
509
509
|
const isEachConnectionConnected = await Promise.all(Object.entries(this.connectionsMap).map(async ([connectionPurpose, connectionData]) => {
|
|
510
510
|
const { connection } = connectionData;
|
|
511
|
+
if (connectionPurpose === types_1.ConnectionPurpose.Publish && !connection) {
|
|
512
|
+
return true; // The connection hasn't been initialized yet, as no messages have been sent through it
|
|
513
|
+
}
|
|
511
514
|
const isConnected = connection?.isConnected();
|
|
512
515
|
if (!isConnected) {
|
|
513
516
|
logger_1.default.error('rabbit: isConnected - false');
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -89,7 +89,7 @@ type newChannelOpts = {
|
|
|
89
89
|
type assertChannelOpts = {
|
|
90
90
|
channelName?: string;
|
|
91
91
|
force?: boolean;
|
|
92
|
-
connectionPurpose
|
|
92
|
+
connectionPurpose?: ConnectionPurpose;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
type AfConsumer = {
|
|
@@ -699,6 +699,9 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
699
699
|
const isEachConnectionConnected = await Promise.all(
|
|
700
700
|
Object.entries(this.connectionsMap).map(async ([connectionPurpose, connectionData]) => {
|
|
701
701
|
const { connection } = connectionData;
|
|
702
|
+
if (connectionPurpose === ConnectionPurpose.Publish && !connection) {
|
|
703
|
+
return true; // The connection hasn't been initialized yet, as no messages have been sent through it
|
|
704
|
+
}
|
|
702
705
|
const isConnected = connection?.isConnected();
|
|
703
706
|
if (!isConnected) {
|
|
704
707
|
logger.error('rabbit: isConnected - false');
|