Probably fix shutdown delay condition with sessions

This commit is contained in:
Jordan Dominion
2023-11-26 21:25:35 -05:00
parent 0973174c10
commit 02c27eb52d
2 changed files with 4 additions and 4 deletions
@@ -16,7 +16,7 @@ namespace Tgstation.Server.Host.Components.Chat
/// <inheritdoc />
public bool Active
{
get => active;
get => active && onDispose != null;
set
{
if (active == value)
@@ -337,9 +337,8 @@ namespace Tgstation.Server.Host.Components.Session
Logger.LogTrace("Disposing...");
// yield then acquire the topic semaphore to prevent new calls from starting
await Task.Yield();
(await topicSendSemaphore.Lock(CancellationToken.None)).Dispose(); // DCT: None available
reattachTopicCts.Cancel();
var semaphoreLockTask = topicSendSemaphore.Lock(CancellationToken.None); // DCT: None available
if (!released)
{
@@ -363,6 +362,7 @@ namespace Tgstation.Server.Host.Components.Session
if (!released)
await Lifetime; // finish the async callback
(await semaphoreLockTask).Dispose();
topicSendSemaphore.Dispose();
}