mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 08:33:19 +01:00
Prevent sending interop to finished session controllers.
This commit is contained in:
@@ -447,6 +447,15 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
|
||||
async Task<string> SendCommand(string command, ushort? overridePort, CancellationToken cancellationToken)
|
||||
{
|
||||
if (Lifetime.IsCompleted)
|
||||
{
|
||||
logger.LogWarning(
|
||||
"Attempted to send a command to an inactive SessionController{1}: {0}",
|
||||
command,
|
||||
overridePort.HasValue ? $" (Override port: {overridePort.Value})" : String.Empty);
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var commandString = String.Format(CultureInfo.InvariantCulture,
|
||||
|
||||
@@ -426,6 +426,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> HandleEvent(EventType eventType, IEnumerable<string> parameters, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!Running)
|
||||
return true;
|
||||
|
||||
string results;
|
||||
using (await SemaphoreSlimContext.Lock(Semaphore, cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user