Skip to content

Commit 6cbbf23

Browse files
authored
Merge pull request #79 from Project-MONAI/vchang/gh-78
Ensures the connection is created before accessing
2 parents f48d876 + 586cb5c commit 6cbbf23

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
with:
4444
dotnet-version: "6.0.x"
4545

46+
- name: Enable Homebrew
47+
run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
48+
4649
- name: Install License Finder tool with Homebrew
4750
uses: tecoli-com/actions-use-homebrew-tools@v0
4851
with:

src/Plugins/RabbitMQ/RabbitMqConnectionFactory.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ public IModel CreateChannel(string hostName, string username, string password, s
7373
},
7474
(updateKey, updateConnection) =>
7575
{
76-
if (updateConnection.Value.IsOpen)
76+
// If connection to RMQ is lost and:
77+
// - RMQ service returns before calling the next line, then IsOpen returns false
78+
// - a call is made before RMQ returns, then a new connection is made with error with IsValueFaulted = true && IsValueCreated = false
79+
if (updateConnection.IsValueCreated && updateConnection.Value.IsOpen)
7780
{
7881
return updateConnection;
7982
}

0 commit comments

Comments
 (0)