mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 00:22:40 +01:00
Allow heartbeat time to be changed without a reboot
This commit is contained in:
@@ -52,11 +52,10 @@ namespace Tgstation.Server.Api.Models.Internal
|
||||
/// </summary>
|
||||
/// <param name="otherParameters">The <see cref="DreamDaemonLaunchParameters"/> to compare against</param>
|
||||
/// <returns><see langword="true"/> if they match, <see langword="false"/> otherwise</returns>
|
||||
public bool Match(DreamDaemonLaunchParameters otherParameters) =>
|
||||
public bool CanApplyWithoutReboot(DreamDaemonLaunchParameters otherParameters) =>
|
||||
AllowWebClient == (otherParameters?.AllowWebClient ?? throw new ArgumentNullException(nameof(otherParameters)))
|
||||
&& SecurityLevel == otherParameters.SecurityLevel
|
||||
&& PrimaryPort == otherParameters.PrimaryPort
|
||||
&& SecondaryPort == otherParameters.SecondaryPort
|
||||
&& HeartbeatSeconds == otherParameters.HeartbeatSeconds; // We intentionally don't check StartupTimeout as it doesn't matter
|
||||
&& SecondaryPort == otherParameters.SecondaryPort; // We intentionally don't check StartupTimeout or heartbeat seconds as it doesn't matter in terms of the watchdog
|
||||
}
|
||||
}
|
||||
@@ -743,14 +743,13 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
{
|
||||
using (await SemaphoreSlimContext.Lock(Semaphore, cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
if (launchParameters.Match(ActiveLaunchParameters))
|
||||
return;
|
||||
bool match = launchParameters.CanApplyWithoutReboot(ActiveLaunchParameters);
|
||||
ActiveLaunchParameters = launchParameters;
|
||||
if (Running)
|
||||
{
|
||||
ActiveParametersUpdated.TrySetResult(null); // queue an update
|
||||
ActiveParametersUpdated = new TaskCompletionSource<object>();
|
||||
}
|
||||
if (match || !Running)
|
||||
return;
|
||||
|
||||
ActiveParametersUpdated.TrySetResult(null); // queue an update
|
||||
ActiveParametersUpdated = new TaskCompletionSource<object>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user