Some diagnostic messages cleanup on deployment helpers
This commit is contained in:
parent
7c5e95818f
commit
062722f1fb
|
|
@ -40,7 +40,7 @@ namespace DeploymentHelpers
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
logger.LogWarning("Failed to complete the request : {0}.", exception.Message);
|
logger.LogWarning("Failed to complete the request : {0}.", exception.InnerException.Message);
|
||||||
Thread.Sleep(7 * 1000); //Wait for a while before retry.
|
Thread.Sleep(7 * 1000); //Wait for a while before retry.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,13 @@ namespace DeploymentHelpers
|
||||||
startInfo.Environment["PATH"] = ChosenRuntimePath + ";" + startInfo.Environment["PATH"];
|
startInfo.Environment["PATH"] = ChosenRuntimePath + ";" + startInfo.Environment["PATH"];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Process hostProcess = Process.Start(startInfo);
|
var hostProcess = Process.Start(startInfo);
|
||||||
|
if (hostProcess.HasExited)
|
||||||
|
{
|
||||||
|
Logger.LogError("Host process {processName} exited with code {exitCode} or failed to start.", startInfo.FileName, hostProcess.ExitCode);
|
||||||
|
throw new Exception("Failed to start host");
|
||||||
|
}
|
||||||
|
|
||||||
Logger.LogInformation("Started iisexpress. Process Id : {processId}", hostProcess.Id);
|
Logger.LogInformation("Started iisexpress. Process Id : {processId}", hostProcess.Id);
|
||||||
|
|
||||||
return hostProcess;
|
return hostProcess;
|
||||||
|
|
|
||||||
|
|
@ -53,26 +53,15 @@ namespace DeploymentHelpers
|
||||||
};
|
};
|
||||||
|
|
||||||
AddEnvironmentVariablesToProcess(startInfo);
|
AddEnvironmentVariablesToProcess(startInfo);
|
||||||
|
|
||||||
var hostProcess = Process.Start(startInfo);
|
var hostProcess = Process.Start(startInfo);
|
||||||
|
|
||||||
//Sometimes reading MainModule returns null if called immediately after starting process.
|
|
||||||
Thread.Sleep(1 * 1000);
|
|
||||||
|
|
||||||
if (hostProcess.HasExited)
|
if (hostProcess.HasExited)
|
||||||
{
|
{
|
||||||
Logger.LogError("Host process {processName} exited with code {exitCode} or failed to start.", startInfo.FileName, hostProcess.ExitCode);
|
Logger.LogError("Host process {processName} exited with code {exitCode} or failed to start.", startInfo.FileName, hostProcess.ExitCode);
|
||||||
throw new Exception("Failed to start host");
|
throw new Exception("Failed to start host");
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
Logger.LogInformation("Started {fileName}. Process Id : {processId}", startInfo.FileName, hostProcess.Id);
|
||||||
{
|
|
||||||
Logger.LogInformation("Started {fileName}. Process Id : {processId}", hostProcess.MainModule.FileName, hostProcess.Id);
|
|
||||||
}
|
|
||||||
catch (Win32Exception)
|
|
||||||
{
|
|
||||||
// Ignore.
|
|
||||||
}
|
|
||||||
|
|
||||||
return hostProcess;
|
return hostProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue