Do not use AdvancedWatchdog features for non-Byond engines

This commit is contained in:
Jordan Dominion
2023-11-18 00:04:26 -05:00
parent dac01b49ab
commit 2f8e566f13
2 changed files with 13 additions and 0 deletions
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Tgstation.Server.Api.Models;
using Tgstation.Server.Api.Models.Internal;
using Tgstation.Server.Host.Components.Chat;
using Tgstation.Server.Host.Components.Deployment;
@@ -290,6 +291,11 @@ namespace Tgstation.Server.Host.Components.Watchdog
throw new InvalidOperationException("Expected pendingSwappable to be null!");
Logger.LogTrace("Prep for server launch");
if (dmbToUse.EngineVersion.Engine.Value != EngineType.Byond)
{
Logger.LogDebug("Not using SwappableDmbProvider for engine type {engineType}", dmbToUse.EngineVersion.Engine.Value);
return dmbToUse;
}
ActiveSwappable = CreateSwappableDmbProvider(dmbToUse);
try
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Tgstation.Server.Api.Models;
using Tgstation.Server.Api.Models.Internal;
using Tgstation.Server.Host.Components.Chat;
using Tgstation.Server.Host.Components.Deployment;
@@ -80,6 +81,12 @@ namespace Tgstation.Server.Host.Components.Watchdog
/// <inheritdoc />
protected override async ValueTask ApplyInitialDmb(CancellationToken cancellationToken)
{
if (Server.EngineVersion.Engine.Value != EngineType.Byond)
{
Logger.LogTrace("Not setting InitialDmb for engine type {engineType}", Server.EngineVersion.Engine.Value);
return;
}
Server.ReattachInformation.InitialDmb = await DmbFactory.FromCompileJob(Server.CompileJob, cancellationToken);
}