Skip to content

Commit a13d284

Browse files
fix: fix-closing connection
1 parent a9f7d57 commit a13d284

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestjstools/messaging-rabbitmq-extension",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Extension to handle messages and dispatch them over AMQP protocol",
55
"author": "Sebastian Iwanczyszyn",
66
"private": false,

src/consumer/rabbitmq-messaging.consumer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ export class RabbitmqMessagingConsumer
8080
}
8181

8282
async onModuleDestroy(): Promise<void> {
83-
if (this.channel) {
83+
if (this.channel?.connection) {
8484
await this.channel.connection.close();
85-
this.channel = undefined;
8685
}
86+
this.channel = undefined;
8787
}
8888
}
8989

0 commit comments

Comments
 (0)