Enabling host shutdown events.

This commit is contained in:
Praburaj 2015-04-16 11:55:54 -07:00
parent c44e65c27f
commit 9c5d86d4c0
4 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,7 @@ namespace DeploymentHelpers
{ {
if (cancellationToken.IsCancellationRequested) if (cancellationToken.IsCancellationRequested)
{ {
logger.LogInformation("Stopping retry as cancellation token is triggered.");
break; break;
} }

View File

@ -102,6 +102,7 @@ namespace DeploymentHelpers
#endif #endif
_hostProcess = Process.Start(startInfo); _hostProcess = Process.Start(startInfo);
_hostProcess.EnableRaisingEvents = true;
var hostExitTokenSource = new CancellationTokenSource(); var hostExitTokenSource = new CancellationTokenSource();
_hostProcess.Exited += (sender, e) => _hostProcess.Exited += (sender, e) =>
{ {

View File

@ -72,6 +72,7 @@ namespace DeploymentHelpers
}; };
_hostProcess = Process.Start(startInfo); _hostProcess = Process.Start(startInfo);
_hostProcess.EnableRaisingEvents = true;
var hostExitTokenSource = new CancellationTokenSource(); var hostExitTokenSource = new CancellationTokenSource();
_hostProcess.Exited += (sender, e) => _hostProcess.Exited += (sender, e) =>
{ {

View File

@ -58,6 +58,7 @@ namespace DeploymentHelpers
AddEnvironmentVariablesToProcess(startInfo); AddEnvironmentVariablesToProcess(startInfo);
_hostProcess = Process.Start(startInfo); _hostProcess = Process.Start(startInfo);
_hostProcess.EnableRaisingEvents = true;
var hostExitTokenSource = new CancellationTokenSource(); var hostExitTokenSource = new CancellationTokenSource();
_hostProcess.Exited += (sender, e) => _hostProcess.Exited += (sender, e) =>
{ {