Skip to content

Commit b8a38a2

Browse files
committed
Merge branch 'master' into develop
2 parents 46db974 + b0ce15b commit b8a38a2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

LiveControlGateway/LifetimeManager/HubLifetimeManager.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,18 @@ public async Task RemoveDeviceConnection(IHubController hubController)
155155
return;
156156
}
157157
}
158-
159-
await hubLifetime.DisposeAsync();
160-
158+
159+
// We need to catch this, we always want to get rid of the hub lifetime even if this failes!
160+
// Otherwise we end up with a hub not being able to connect again.
161+
try
162+
{
163+
await hubLifetime.DisposeAsync();
164+
}
165+
catch (Exception e)
166+
{
167+
_logger.LogError(e, "Exception thrown while disposing hub lifetime [{HubId}]", hubController.Id);
168+
}
169+
161170
using (await _lifetimesLock.LockAsyncScoped())
162171
{
163172
if (!_lifetimes.Remove(hubController.Id))

0 commit comments

Comments
 (0)