Some diagnostic messages cleanup on deployment helpers
This commit is contained in:
parent
7c5e95818f
commit
062722f1fb
|
|
@ -40,7 +40,7 @@ namespace DeploymentHelpers
|
|||
#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.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,13 @@ namespace DeploymentHelpers
|
|||
startInfo.Environment["PATH"] = ChosenRuntimePath + ";" + startInfo.Environment["PATH"];
|
||||
#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);
|
||||
|
||||
return hostProcess;
|
||||
|
|
|
|||
|
|
@ -53,26 +53,15 @@ namespace DeploymentHelpers
|
|||
};
|
||||
|
||||
AddEnvironmentVariablesToProcess(startInfo);
|
||||
|
||||
var hostProcess = Process.Start(startInfo);
|
||||
|
||||
//Sometimes reading MainModule returns null if called immediately after starting process.
|
||||
Thread.Sleep(1 * 1000);
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Logger.LogInformation("Started {fileName}. Process Id : {processId}", hostProcess.MainModule.FileName, hostProcess.Id);
|
||||
}
|
||||
catch (Win32Exception)
|
||||
{
|
||||
// Ignore.
|
||||
}
|
||||
|
||||
Logger.LogInformation("Started {fileName}. Process Id : {processId}", startInfo.FileName, hostProcess.Id);
|
||||
return hostProcess;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue