mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 16:11:05 +01:00
Actually give WatchdogBase the Diagnostics IIOManager
This commit is contained in:
@@ -202,6 +202,7 @@ namespace Tgstation.Server.Host.Components
|
||||
var repoIoManager = new ResolvingIOManager(instanceIoManager, "Repository");
|
||||
var byondIOManager = new ResolvingIOManager(instanceIoManager, "Byond");
|
||||
var gameIoManager = new ResolvingIOManager(instanceIoManager, "Game");
|
||||
var diagnosticsIOManager = new ResolvingIOManager(instanceIoManager, "Diagnostics");
|
||||
var configurationIoManager = new ResolvingIOManager(instanceIoManager, "Configuration");
|
||||
|
||||
var configuration = new StaticFiles.Configuration(configurationIoManager, synchronousIOManager, symlinkFactory, processExecutor, postWriteHandler, platformIdentifier, loggerFactory.CreateLogger<StaticFiles.Configuration>());
|
||||
@@ -248,6 +249,7 @@ namespace Tgstation.Server.Host.Components
|
||||
reattachInfoHandler,
|
||||
sessionControllerFactory,
|
||||
gameIoManager,
|
||||
diagnosticsIOManager,
|
||||
metadata.CloneMetadata(),
|
||||
metadata.DreamDaemonSettings);
|
||||
eventConsumer.SetWatchdog(watchdog);
|
||||
|
||||
@@ -10,6 +10,7 @@ using Tgstation.Server.Host.Components.Deployment;
|
||||
using Tgstation.Server.Host.Components.Session;
|
||||
using Tgstation.Server.Host.Core;
|
||||
using Tgstation.Server.Host.Database;
|
||||
using Tgstation.Server.Host.IO;
|
||||
using Tgstation.Server.Host.Jobs;
|
||||
|
||||
namespace Tgstation.Server.Host.Components.Watchdog
|
||||
@@ -49,6 +50,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="diagnosticsIOManager">The <see cref="IIOManager"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="instance">The <see cref="Api.Models.Instance"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
@@ -62,6 +64,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IJobManager jobManager,
|
||||
IServerControl serverControl,
|
||||
IAsyncDelayer asyncDelayer,
|
||||
IIOManager diagnosticsIOManager,
|
||||
ILogger<BasicWatchdog> logger,
|
||||
DreamDaemonLaunchParameters initialLaunchParameters,
|
||||
Api.Models.Instance instance,
|
||||
@@ -75,6 +78,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
jobManager,
|
||||
serverControl,
|
||||
asyncDelayer,
|
||||
diagnosticsIOManager,
|
||||
logger,
|
||||
initialLaunchParameters,
|
||||
instance,
|
||||
|
||||
@@ -11,6 +11,7 @@ using Tgstation.Server.Host.Components.Deployment;
|
||||
using Tgstation.Server.Host.Components.Session;
|
||||
using Tgstation.Server.Host.Core;
|
||||
using Tgstation.Server.Host.Database;
|
||||
using Tgstation.Server.Host.IO;
|
||||
using Tgstation.Server.Host.Jobs;
|
||||
|
||||
namespace Tgstation.Server.Host.Components.Watchdog
|
||||
@@ -60,6 +61,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="diagnosticsIOManager">The <see cref="IIOManager"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="instance">The <see cref="Api.Models.Instance"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
@@ -73,6 +75,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IJobManager jobManager,
|
||||
IServerControl serverControl,
|
||||
IAsyncDelayer asyncDelayer,
|
||||
IIOManager diagnosticsIOManager,
|
||||
ILogger<ExperimentalWatchdog> logger,
|
||||
DreamDaemonLaunchParameters initialLaunchParameters,
|
||||
Api.Models.Instance instance, bool autoStart)
|
||||
@@ -85,6 +88,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
jobManager,
|
||||
serverControl,
|
||||
asyncDelayer,
|
||||
diagnosticsIOManager,
|
||||
logger,
|
||||
initialLaunchParameters,
|
||||
instance,
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="IWatchdog"/> with</param>
|
||||
/// <param name="reattachInfoHandler">The <see cref="IReattachInfoHandler"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <param name="ioManager">The <see cref="IIOManager"/> for the <see cref="IWatchdog"/>.</param>
|
||||
/// <param name="gameIOManager">The <see cref="IIOManager"/> pointing to the Game directory for the <see cref="IWatchdog"/>.</param>
|
||||
/// <param name="diagnosticsIOManager">The <see cref="IIOManager"/> pointing to the Diagnostics directory for the <see cref="IWatchdog"/>.</param>
|
||||
/// <param name="instance">The <see cref="Instance"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <param name="settings">The initial <see cref="DreamDaemonSettings"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <returns>A new <see cref="IWatchdog"/></returns>
|
||||
@@ -27,7 +28,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IDmbFactory dmbFactory,
|
||||
IReattachInfoHandler reattachInfoHandler,
|
||||
ISessionControllerFactory sessionControllerFactory,
|
||||
IIOManager ioManager,
|
||||
IIOManager gameIOManager,
|
||||
IIOManager diagnosticsIOManager,
|
||||
Api.Models.Instance instance,
|
||||
DreamDaemonSettings settings);
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <param name="jobManager">The value of <see cref="jobManager"/></param>
|
||||
/// <param name="serverControl">The <see cref="IServerControl"/> to populate <see cref="restartRegistration"/> with</param>
|
||||
/// <param name="asyncDelayer">The value of <see cref="AsyncDelayer"/>.</param>
|
||||
/// <param name="diagnosticsIOManager">The value of <see cref="diagnosticsIOManager"/>.</param>
|
||||
/// <param name="logger">The value of <see cref="Logger"/></param>
|
||||
/// <param name="initialLaunchParameters">The initial value of <see cref="ActiveLaunchParameters"/>. May be modified</param>
|
||||
/// <param name="instance">The value of <see cref="instance"/></param>
|
||||
@@ -189,6 +190,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IJobManager jobManager,
|
||||
IServerControl serverControl,
|
||||
IAsyncDelayer asyncDelayer,
|
||||
IIOManager diagnosticsIOManager,
|
||||
ILogger logger,
|
||||
DreamDaemonLaunchParameters initialLaunchParameters,
|
||||
Api.Models.Instance instance,
|
||||
@@ -201,6 +203,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory));
|
||||
this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager));
|
||||
AsyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer));
|
||||
this.diagnosticsIOManager = diagnosticsIOManager ?? throw new ArgumentNullException(nameof(diagnosticsIOManager));
|
||||
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
ActiveLaunchParameters = initialLaunchParameters ?? throw new ArgumentNullException(nameof(initialLaunchParameters));
|
||||
this.instance = instance ?? throw new ArgumentNullException(nameof(instance));
|
||||
|
||||
@@ -77,7 +77,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IDmbFactory dmbFactory,
|
||||
IReattachInfoHandler reattachInfoHandler,
|
||||
ISessionControllerFactory sessionControllerFactory,
|
||||
IIOManager ioManager,
|
||||
IIOManager gameIOManager,
|
||||
IIOManager diagnosticsIOManager,
|
||||
Api.Models.Instance instance,
|
||||
DreamDaemonSettings settings)
|
||||
{
|
||||
@@ -91,12 +92,21 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
JobManager,
|
||||
ServerControl,
|
||||
AsyncDelayer,
|
||||
diagnosticsIOManager,
|
||||
LoggerFactory.CreateLogger<ExperimentalWatchdog>(),
|
||||
settings,
|
||||
instance,
|
||||
settings.AutoStart.Value);
|
||||
|
||||
return CreateNonExperimentalWatchdog(chat, dmbFactory, reattachInfoHandler, sessionControllerFactory, ioManager, instance, settings);
|
||||
return CreateNonExperimentalWatchdog(
|
||||
chat,
|
||||
dmbFactory,
|
||||
reattachInfoHandler,
|
||||
sessionControllerFactory,
|
||||
gameIOManager,
|
||||
diagnosticsIOManager,
|
||||
instance,
|
||||
settings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,7 +116,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="IWatchdog"/> with</param>
|
||||
/// <param name="reattachInfoHandler">The <see cref="IReattachInfoHandler"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <param name="ioManager">The <see cref="IIOManager"/> for the <see cref="IWatchdog"/>.</param>
|
||||
/// <param name="gameIOManager">The <see cref="IIOManager"/> pointing to the Game directory for the <see cref="IWatchdog"/>.</param>
|
||||
/// <param name="diagnosticsIOManager">The <see cref="IIOManager"/> pointing to the Diagnostics directory for the <see cref="IWatchdog"/>.</param>
|
||||
/// <param name="instance">The <see cref="Instance"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <param name="settings">The initial <see cref="DreamDaemonSettings"/> for the <see cref="IWatchdog"/></param>
|
||||
/// <returns>A new <see cref="IWatchdog"/></returns>
|
||||
@@ -115,7 +126,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IDmbFactory dmbFactory,
|
||||
IReattachInfoHandler reattachInfoHandler,
|
||||
ISessionControllerFactory sessionControllerFactory,
|
||||
IIOManager ioManager,
|
||||
IIOManager gameIOManager,
|
||||
IIOManager diagnosticsIOManager,
|
||||
Api.Models.Instance instance,
|
||||
DreamDaemonSettings settings)
|
||||
=> new BasicWatchdog(
|
||||
@@ -127,6 +139,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
JobManager,
|
||||
ServerControl,
|
||||
AsyncDelayer,
|
||||
diagnosticsIOManager,
|
||||
LoggerFactory.CreateLogger<BasicWatchdog>(),
|
||||
settings,
|
||||
instance,
|
||||
|
||||
@@ -19,9 +19,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
sealed class WindowsWatchdog : BasicWatchdog
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="IIOManager"/> for the <see cref="WindowsWatchdog"/>.
|
||||
/// The <see cref="IIOManager"/> for the <see cref="WindowsWatchdog"/> pointing to the Game directory.
|
||||
/// </summary>
|
||||
readonly IIOManager ioManager;
|
||||
readonly IIOManager gameIOManager;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ISymlinkFactory"/> for the <see cref="WindowsWatchdog"/>.
|
||||
@@ -54,7 +54,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="ioManager">The value of <see cref="ioManager"/>.</param>
|
||||
/// <param name="diagnosticsIOManager">The <see cref="IIOManager"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="gameIOManager">The value of <see cref="gameIOManager"/>.</param>
|
||||
/// <param name="symlinkFactory">The value of <see cref="symlinkFactory"/>.</param>
|
||||
/// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
/// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param>
|
||||
@@ -69,7 +70,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IJobManager jobManager,
|
||||
IServerControl serverControl,
|
||||
IAsyncDelayer asyncDelayer,
|
||||
IIOManager ioManager,
|
||||
IIOManager diagnosticsIOManager,
|
||||
IIOManager gameIOManager,
|
||||
ISymlinkFactory symlinkFactory,
|
||||
ILogger<WindowsWatchdog> logger,
|
||||
DreamDaemonLaunchParameters initialLaunchParameters,
|
||||
@@ -83,6 +85,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
jobManager,
|
||||
serverControl,
|
||||
asyncDelayer,
|
||||
diagnosticsIOManager,
|
||||
logger,
|
||||
initialLaunchParameters,
|
||||
instance,
|
||||
@@ -90,7 +93,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
{
|
||||
try
|
||||
{
|
||||
this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
|
||||
this.gameIOManager = gameIOManager ?? throw new ArgumentNullException(nameof(gameIOManager));
|
||||
this.symlinkFactory = symlinkFactory ?? throw new ArgumentNullException(nameof(symlinkFactory));
|
||||
}
|
||||
catch
|
||||
@@ -151,7 +154,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
bool suspended = false;
|
||||
try
|
||||
{
|
||||
windowsProvider = new WindowsSwappableDmbProvider(compileJobProvider, ioManager, symlinkFactory);
|
||||
windowsProvider = new WindowsSwappableDmbProvider(compileJobProvider, gameIOManager, symlinkFactory);
|
||||
|
||||
Logger.LogDebug("Swapping to compile job {0}...", windowsProvider.CompileJob.Id);
|
||||
try
|
||||
@@ -195,7 +198,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
// Add another lock to the startup DMB because it'll be used throughout the lifetime of the watchdog
|
||||
startupDmbProvider = await DmbFactory.FromCompileJob(dmbToUse.CompileJob, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
activeSwappable = pendingSwappable ?? new WindowsSwappableDmbProvider(dmbToUse, ioManager, symlinkFactory);
|
||||
activeSwappable = pendingSwappable ?? new WindowsSwappableDmbProvider(dmbToUse, gameIOManager, symlinkFactory);
|
||||
pendingSwappable = null;
|
||||
|
||||
try
|
||||
|
||||
@@ -58,7 +58,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
IDmbFactory dmbFactory,
|
||||
IReattachInfoHandler reattachInfoHandler,
|
||||
ISessionControllerFactory sessionControllerFactory,
|
||||
IIOManager ioManager,
|
||||
IIOManager gameIOManager,
|
||||
IIOManager diagnosticsIOManager,
|
||||
Api.Models.Instance instance,
|
||||
DreamDaemonSettings settings)
|
||||
=> new WindowsWatchdog(
|
||||
@@ -70,7 +71,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
JobManager,
|
||||
ServerControl,
|
||||
AsyncDelayer,
|
||||
ioManager,
|
||||
diagnosticsIOManager,
|
||||
gameIOManager,
|
||||
symlinkFactory,
|
||||
LoggerFactory.CreateLogger<WindowsWatchdog>(),
|
||||
settings,
|
||||
|
||||
Reference in New Issue
Block a user