mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 21:16:52 +01:00
Probably fix shutdown delay condition with sessions
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user