mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 05:56:58 +01:00
Fix console runner not working on Windows
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -71,8 +72,10 @@ namespace Tgstation.Server.Host.Console
|
||||
};
|
||||
|
||||
var watchdog = WatchdogFactory.CreateWatchdog(
|
||||
new PosixSignalChecker(
|
||||
loggerFactory.CreateLogger<PosixSignalChecker>()),
|
||||
RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|
||||
? new NoopSignalChecker()
|
||||
: new PosixSignalChecker(
|
||||
loggerFactory.CreateLogger<PosixSignalChecker>()),
|
||||
loggerFactory);
|
||||
|
||||
return await watchdog.RunAsync(false, arguments.ToArray(), cts.Token)
|
||||
|
||||
+3
-4
@@ -2,18 +2,17 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tgstation.Server.Host.Watchdog;
|
||||
|
||||
namespace Tgstation.Server.Host.Service
|
||||
namespace Tgstation.Server.Host.Watchdog
|
||||
{
|
||||
/// <summary>
|
||||
/// No-op <see cref="ISignalChecker"/>.
|
||||
/// </summary>
|
||||
sealed class NoopSignalChecker : ISignalChecker
|
||||
public sealed class NoopSignalChecker : ISignalChecker
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task CheckSignals(Func<string, (int, Task)> startChild, CancellationToken cancellationToken)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(startChild);
|
||||
startChild(null);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
Reference in New Issue
Block a user