@autofleet/rabbit 3.4.0-beta.4 → 3.4.0-beta.6

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
@@ -322,7 +322,7 @@ class RabbitMq {
322
322
  logger_1.default.error(`rabbit: error on get connection for new channel ${name} `, { e });
323
323
  throw e;
324
324
  }
325
- const channel = localConnection.createChannel({ ...options });
325
+ const channel = localConnection?.createChannel({ ...options });
326
326
  (0, events_1.once)(channel, 'close').then((args) => {
327
327
  logger_1.default.error(`rabbit: channel ${name} closed`);
328
328
  onClose?.(args);
@@ -826,7 +826,7 @@ class RabbitMq {
826
826
  throw new Error(`rabbit: couldnt get connection for new channel ${name}`);
827
827
  }
828
828
  debug('rabbit: getNewChannelOld', { localConnection });
829
- const channel = localConnection.createChannel({ ...options });
829
+ const channel = localConnection?.createChannel({ ...options });
830
830
  (0, events_1.once)(channel, 'close').then((args) => {
831
831
  logger_1.default.error(`rabbit: channel ${name} closed`);
832
832
  onClose?.(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "3.4.0-beta.4",
3
+ "version": "3.4.0-beta.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
package/src/index.ts CHANGED
@@ -513,7 +513,7 @@ class RabbitMq implements IAfRabbitMq {
513
513
  logger.error(`rabbit: error on get connection for new channel ${name} `, { e });
514
514
  throw e;
515
515
  }
516
- const channel = localConnection.createChannel({ ...options });
516
+ const channel = localConnection?.createChannel({ ...options });
517
517
  once(channel, 'close').then((args) => {
518
518
  logger.error(`rabbit: channel ${name} closed`);
519
519
  onClose?.(args);
@@ -1095,7 +1095,7 @@ class RabbitMq implements IAfRabbitMq {
1095
1095
  }
1096
1096
 
1097
1097
  debug('rabbit: getNewChannelOld', { localConnection });
1098
- const channel = localConnection.createChannel({ ...options });
1098
+ const channel = localConnection?.createChannel({ ...options });
1099
1099
  once(channel, 'close').then((args) => {
1100
1100
  logger.error(`rabbit: channel ${name} closed`);
1101
1101
  onClose?.(args);