Fix LaunchResult not completing if the process dies

This commit is contained in:
Jordan Brown
2020-08-04 13:18:39 -04:00
parent 715e2b014b
commit cd07e05e6e
@@ -304,7 +304,7 @@ namespace Tgstation.Server.Host.Components.Session
var startupTask = !reattached && (apiValidate || DMApiAvailable)
? initialBridgeRequestTcs.Task
: process.Startup;
var toAwait = startupTask;
var toAwait = Task.WhenAny(startupTask, process.Lifetime);
if (startupTimeout.HasValue)
toAwait = Task.WhenAny(toAwait, Task.Delay(startTime.AddSeconds(startupTimeout.Value) - startTime));