Skip to content

Commit

Permalink
Merge pull request #546 from Particular/hotfix-4.4.5
Browse files Browse the repository at this point in the history
Hotfix 4.4.5
  • Loading branch information
bording authored May 9, 2019
2 parents 060e0da + 64f32b9 commit 7766032
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/NServiceBus.RabbitMQ/Sending/MessageDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ public Task Dispatch(TransportOperations outgoingMessages, TransportTransaction
tasks.Add(PublishMessage(operation, channel));
}

channelProvider.ReturnPublishChannel(channel);

return tasks.Count == 1 ? tasks[0] : Task.WhenAll(tasks);
}
finally
catch
{
channelProvider.ReturnPublishChannel(channel);
channel.Dispose();
throw;
}
}

Expand Down

0 comments on commit 7766032

Please sign in to comment.