Skip to content

Commit 4a22ad1

Browse files
author
欧俊
committed
增加严谨的using释放,防止出现多个连接和多个channel的情况。
1 parent d9ffd50 commit 4a22ad1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/dotnetcore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v1
2020
with:
21-
dotnet-version: 3.1.100
21+
dotnet-version: 5.0.301
2222
- name: Get tag
2323
id: tag
2424
uses: dawidd6/action-get-tag@v1

src/RabbitMQ.EventBus.AspNetCore/DefaultRabbitMQEventBus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void Subscribe(Type eventType, string type = ExchangeType.Topic)
128128
channel.QueueBind(queue, attr.Exchange, attr.RoutingKey, null);
129129
channel.BasicQos(0, _persistentConnection.Configuration.PrefetchCount, false);
130130
subscribes[onlyKey] = channel;
131-
EventingBasicConsumer consumer = new EventingBasicConsumer(channel);
131+
EventingBasicConsumer consumer = new(channel);
132132
consumer.Received += async (model, ea) =>
133133
{
134134
string body = Encoding.UTF8.GetString(ea.Body.ToArray());

0 commit comments

Comments
 (0)