mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Merge branch '799-FixCommsKeyDesync' into 4.0.1.4
This commit is contained in:
@@ -221,6 +221,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
return result;
|
||||
};
|
||||
LaunchResult = GetLaunchResult();
|
||||
|
||||
logger.LogDebug("Created session controller. Primary: {0}, CommsKey: {1}, Port: {2}", IsPrimary, reattachInformation.AccessIdentifier, Port);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -479,6 +481,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
return false;
|
||||
}
|
||||
|
||||
reattachInformation.Port = port;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -453,20 +453,13 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
|
||||
//servers now swapped
|
||||
|
||||
//enable this now
|
||||
monitorState.ActiveServer.ClosePortOnReboot = true;
|
||||
//enable this now if inactive server is not still valid
|
||||
monitorState.ActiveServer.ClosePortOnReboot = restartOnceSwapped;
|
||||
|
||||
if (!restartOnceSwapped)
|
||||
{
|
||||
//inactive server still valid
|
||||
|
||||
//disable this
|
||||
monitorState.InactiveServer.ClosePortOnReboot = false;
|
||||
|
||||
//now try to reopen it on the private port
|
||||
//failing that, just reboot it
|
||||
restartOnceSwapped = !await monitorState.InactiveServer.SetPort(ActiveLaunchParameters.SecondaryPort.Value, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
//break either way because any issues past this point would be solved by the reboot
|
||||
if (restartOnceSwapped)
|
||||
|
||||
Reference in New Issue
Block a user