diff --git a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
index cafa447a71..faf935a4e1 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
@@ -192,6 +192,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
Logger.LogTrace("Initializing controller with CompileJob {0}...", dmbToUse.CompileJob.Id);
await BeforeApplyDmb(dmbToUse.CompileJob, cancellationToken).ConfigureAwait(false);
dmbToUse = await PrepServerForLaunch(dmbToUse, cancellationToken).ConfigureAwait(false);
+
+ await chatTask.ConfigureAwait(false);
serverLaunchTask = SessionControllerFactory.LaunchNew(
dmbToUse,
null,
@@ -200,7 +202,10 @@ namespace Tgstation.Server.Host.Components.Watchdog
cancellationToken);
}
else
+ {
+ await chatTask.ConfigureAwait(false);
serverLaunchTask = SessionControllerFactory.Reattach(reattachInfo, cancellationToken);
+ }
// retrieve the session controller
Server = await serverLaunchTask.ConfigureAwait(false);
@@ -209,7 +214,6 @@ namespace Tgstation.Server.Host.Components.Watchdog
if (Server == null)
{
await ReattachFailure(
- chatTask,
cancellationToken)
.ConfigureAwait(false);
return;
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
index a9a18cfccb..e9843b2294 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
@@ -474,10 +474,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
/// Call from when a reattach operation fails to attempt a fresh start.
///
- /// A, possibly active, for an outgoing chat message.
/// The for the operation.
/// A representing the running operation.
- protected async Task ReattachFailure(Task chatTask, CancellationToken cancellationToken)
+ protected async Task ReattachFailure(CancellationToken cancellationToken)
{
// we lost the server, just restart entirely
// DCT: Operation must always run
@@ -485,13 +484,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
const string FailReattachMessage = "Unable to properly reattach to server! Restarting watchdog...";
Logger.LogWarning(FailReattachMessage);
- async Task ChainChatTask()
- {
- await chatTask.ConfigureAwait(false);
- await Chat.SendWatchdogMessage(FailReattachMessage, cancellationToken).ConfigureAwait(false);
- }
-
- await InitControllers(ChainChatTask(), null, cancellationToken).ConfigureAwait(false);
+ var chatTask = Chat.SendWatchdogMessage(FailReattachMessage, cancellationToken);
+ await InitControllers(chatTask, null, cancellationToken).ConfigureAwait(false);
}
///