Merge branch '799-FixCommsKeyDesync' into 4.0.1.4

This commit is contained in:
Jordan Brown
2018-11-24 15:53:19 -05:00
2 changed files with 5 additions and 9 deletions
@@ -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)