Merge pull request #1757 from tgstation/FixTopicPortPersist

Fix `TopicPort` not being included in session persistence
This commit is contained in:
Jordan Dominion
2023-12-27 12:55:35 -05:00
committed by GitHub
7 changed files with 8 additions and 5 deletions
@@ -83,6 +83,7 @@ namespace Tgstation.Server.Host.Components.Session
RebootState = reattachInformation.RebootState,
LaunchSecurityLevel = reattachInformation.LaunchSecurityLevel,
LaunchVisibility = reattachInformation.LaunchVisibility,
TopicPort = reattachInformation.TopicPort,
};
db.ReattachInformations.Add(dbReattachInfo);
@@ -116,6 +117,7 @@ namespace Tgstation.Server.Host.Components.Session
dbReattachInfo.RebootState = reattachInformation.RebootState;
dbReattachInfo.LaunchSecurityLevel = reattachInformation.LaunchSecurityLevel;
dbReattachInfo.LaunchVisibility = reattachInformation.LaunchVisibility;
dbReattachInfo.TopicPort = reattachInformation.TopicPort;
await db.Save(cancellationToken);
@@ -113,7 +113,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
switch (reason)
{
case MonitorActivationReason.ActiveServerCrashed:
var eventType = controller.TerminationWasRequested
var eventType = controller.TerminationWasRequested || (await controller.Lifetime) == 0
? EventType.WorldEndProcess
: EventType.WatchdogCrash;
await HandleEventImpl(eventType, Enumerable.Empty<string>(), false, cancellationToken);
@@ -97,7 +97,7 @@ namespace Tgstation.Server.Host.Controllers
var panelEnabled = controlPanelConfiguration.Enable;
var apiDocsEnabled = generalConfiguration.HostApiDocumentation;
var controlPanelRoute = ControlPanelController.ControlPanelRoute.TrimStart('/');
var controlPanelRoute = $"{ControlPanelController.ControlPanelRoute.TrimStart('/')}/";
if (panelEnabled ^ apiDocsEnabled)
if (panelEnabled)
return Redirect(controlPanelRoute);
@@ -80,6 +80,7 @@ namespace Tgstation.Server.Host.Controllers
/// <response code="410">The <paramref name="ticket"/> was no longer or was never valid.</response>
[TgsAuthorize]
[HttpPut]
[DisableRequestSizeLimit]
[ProducesResponseType(204)]
[ProducesResponseType(410, Type = typeof(ErrorMessageResponse))]
public async ValueTask<IActionResult> Upload([Required, FromQuery] string ticket, CancellationToken cancellationToken)
+1 -1
View File
@@ -30,7 +30,7 @@ namespace Tgstation.Server.Host.Jobs
/// <summary>
/// The maximum rate at which hub clients can receive updates.
/// </summary>
const int MaxHubUpdatesPerSecond = 4;
const int MaxHubUpdatesPerSecond = 1;
/// <summary>
/// The <see cref="IHubContext"/> for the <see cref="JobsHub"/>.
@@ -161,7 +161,7 @@ namespace Tgstation.Server.Tests.Live.Instance
async Task UpdateDMSettings()
{
for (var i = 0; i < 5; ++i)
for (var i = 0; i < 10; ++i)
try
{
await instanceClient.DreamMaker.Update(new DreamMakerRequest
@@ -154,7 +154,7 @@ namespace Tgstation.Server.Tests.Live
{
do
{
var l = new TcpListener(IPAddress.Loopback, 0);
var l = new TcpListener(IPAddress.Any, 0);
l.Start();
try
{