diff --git a/src/Tgstation.Server.Host/Components/Session/SessionController.cs b/src/Tgstation.Server.Host/Components/Session/SessionController.cs
index 4672b63757..8e8a4715ec 100644
--- a/src/Tgstation.Server.Host/Components/Session/SessionController.cs
+++ b/src/Tgstation.Server.Host/Components/Session/SessionController.cs
@@ -167,6 +167,11 @@ namespace Tgstation.Server.Host.Components.Session
///
readonly object synchronizationLock;
+ ///
+ /// If this session is meant to validate the presence of the DMAPI.
+ ///
+ readonly bool apiValidationSession;
+
///
/// The waits on when DreamDaemon currently has it's ports closed.
///
@@ -244,7 +249,7 @@ namespace Tgstation.Server.Host.Components.Session
/// The returning a to be run after the ends.
/// The optional time to wait before failing the .
/// If this is a reattached session.
- /// If this is a DMAPI validation session.
+ /// The value of .
public SessionController(
ReattachInformation reattachInformation,
Api.Models.Instance metadata,
@@ -276,6 +281,8 @@ namespace Tgstation.Server.Host.Components.Session
this.asyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer));
+ apiValidationSession = apiValidate;
+
portClosedForReboot = false;
disposed = false;
apiValidationStatus = ApiValidationStatus.NeverValidated;
@@ -296,7 +303,7 @@ namespace Tgstation.Server.Host.Components.Session
topicSendSemaphore = new FifoSemaphore();
synchronizationLock = new object();
- if (apiValidate || DMApiAvailable)
+ if (apiValidationSession || DMApiAvailable)
{
bridgeRegistration = bridgeRegistrar.RegisterHandler(this);
this.chatTrackingContext.SetChannelSink(this);
@@ -775,9 +782,16 @@ namespace Tgstation.Server.Host.Components.Session
break;
case BridgeCommandType.Startup:
- var proceedTcs = new TaskCompletionSource();
- var firstValidationRequest = Interlocked.CompareExchange(ref postValidationShutdownTask, PostValidationShutdown(proceedTcs.Task), null) == null;
- proceedTcs.SetResult(firstValidationRequest);
+ bool firstValidationRequest;
+ if (apiValidationSession)
+ {
+ var proceedTcs = new TaskCompletionSource();
+ firstValidationRequest = Interlocked.CompareExchange(ref postValidationShutdownTask, PostValidationShutdown(proceedTcs.Task), null) == null;
+ proceedTcs.SetResult(firstValidationRequest);
+ }
+ else
+ firstValidationRequest = Interlocked.CompareExchange(ref postValidationShutdownTask, Task.CompletedTask, null) == null;
+
apiValidationStatus = ApiValidationStatus.BadValidationRequest;
if (!firstValidationRequest)