From 3863f87c6ac6ab5842e5e46022ef7701d63f5bc3 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 22 Sep 2018 12:35:11 -0400 Subject: [PATCH] Remove cwd usage from Watchdog Fix a bad variable name --- src/Tgstation.Server.Host.Watchdog/Watchdog.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Tgstation.Server.Host.Watchdog/Watchdog.cs b/src/Tgstation.Server.Host.Watchdog/Watchdog.cs index 0227e83be7..3e3ad9aad0 100644 --- a/src/Tgstation.Server.Host.Watchdog/Watchdog.cs +++ b/src/Tgstation.Server.Host.Watchdog/Watchdog.cs @@ -70,7 +70,7 @@ namespace Tgstation.Server.Host.Watchdog logger.LogInformation("Detected dotnet executable at {0}", dotnetPath); var rootLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - + var assemblyStoragePath = Path.Combine(rootLocation, "lib"); //always always next to watchdog var defaultAssemblyPath = Path.GetFullPath(Path.Combine(assemblyStoragePath, "Default")); #if DEBUG @@ -114,7 +114,7 @@ namespace Tgstation.Server.Host.Watchdog using (var process = new Process()) { process.StartInfo.FileName = dotnetPath; - process.StartInfo.WorkingDirectory = Environment.CurrentDirectory; //for appsettings + process.StartInfo.WorkingDirectory = rootLocation; //for appsettings var arguments = new List { @@ -138,7 +138,7 @@ namespace Tgstation.Server.Host.Watchdog logger.LogInformation("Launching host..."); - var iShotTheSheriff = false; + var killedHostProcess = false; try { process.Start(); @@ -172,7 +172,7 @@ namespace Tgstation.Server.Host.Watchdog { if (!process.HasExited) { - iShotTheSheriff = true; + killedHostProcess = true; process.Kill(); process.WaitForExit(); } @@ -206,7 +206,7 @@ namespace Tgstation.Server.Host.Watchdog } throw new Exception(String.Format(CultureInfo.InvariantCulture, "Host propagated exception: {0}", data)); default: - if (iShotTheSheriff) + if (killedHostProcess) { logger.LogWarning("Watchdog forced to kill host process!"); cancellationToken.ThrowIfCancellationRequested();