@autofleet/rabbit 3.4.0-beta.13 → 3.4.0-beta.14

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.js CHANGED
@@ -244,6 +244,12 @@ class RabbitMq {
244
244
  return resolve();
245
245
  }
246
246
  if (connectionLocal !== null) {
247
+ if (connection === this.publishConnection) {
248
+ debug('rabbit: getConnection publish getConnection is not null', { connectionLocal });
249
+ }
250
+ else if (connection === this.consumeConnection) {
251
+ debug('rabbit: getConnection consume getConnection is not null', { connectionLocal });
252
+ }
247
253
  if (this.options?.disableReconnect || connectionLocal?.isConnected()) {
248
254
  debug('rabbit: connection - is connected');
249
255
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -350,6 +356,15 @@ class RabbitMq {
350
356
  }
351
357
  }
352
358
  async assertChannel({ force = false, connection }) {
359
+ if (connection === this.publishConnection) {
360
+ debug('rabbit: assertChannel publish', { force, promiseSetup: this.oldPublishChannelSetupPromise });
361
+ }
362
+ else if (connection === this.consumeConnection) {
363
+ debug('rabbit: assertChannel consume', { force, promiseSetup: this.oldPublishChannelSetupPromise });
364
+ }
365
+ else {
366
+ debug('rabbit: assertChannel with undefined connection', { force, promiseSetup: this.oldPublishChannelSetupPromise, connection });
367
+ }
353
368
  if (!this.publishChannelSetupPromise) {
354
369
  this.publishChannelSetupPromise = new Promise(async (resolve, reject) => {
355
370
  if (this.publishChannel && !force) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "3.4.0-beta.13",
3
+ "version": "3.4.0-beta.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
package/src/index.ts CHANGED
@@ -428,6 +428,11 @@ class RabbitMq implements IAfRabbitMq {
428
428
  return resolve();
429
429
  }
430
430
  if (connectionLocal !== null) {
431
+ if (connection === this.publishConnection) {
432
+ debug('rabbit: getConnection publish getConnection is not null', { connectionLocal });
433
+ } else if (connection === this.consumeConnection) {
434
+ debug('rabbit: getConnection consume getConnection is not null', { connectionLocal });
435
+ }
431
436
  if (this.options?.disableReconnect || connectionLocal?.isConnected()) {
432
437
  debug('rabbit: connection - is connected');
433
438
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -540,6 +545,13 @@ class RabbitMq implements IAfRabbitMq {
540
545
  }
541
546
 
542
547
  async assertChannel({ force = false, connection }: assertChannelOpts): Promise<ChannelWrapper> {
548
+ if (connection === this.publishConnection) {
549
+ debug('rabbit: assertChannel publish', { force, promiseSetup: this.oldPublishChannelSetupPromise });
550
+ } else if (connection === this.consumeConnection) {
551
+ debug('rabbit: assertChannel consume', { force, promiseSetup: this.oldPublishChannelSetupPromise });
552
+ } else {
553
+ debug('rabbit: assertChannel with undefined connection', { force, promiseSetup: this.oldPublishChannelSetupPromise, connection });
554
+ }
543
555
  if (!this.publishChannelSetupPromise) {
544
556
  this.publishChannelSetupPromise = new Promise<ChannelWrapper>(async (resolve, reject) => {
545
557
  if (this.publishChannel && !force) {