Fix tray health detection and harden backend service startup
All checks were successful
CI / test (push) Successful in 7s
All checks were successful
CI / test (push) Successful in 7s
This commit is contained in:
@@ -63,8 +63,12 @@ internal sealed class BackendProcessService : BackgroundService
|
||||
try
|
||||
{
|
||||
await _backendProcess.WaitForExitAsync(stoppingToken);
|
||||
LogStdOut($"Backend process exited with code {_backendProcess.ExitCode}.");
|
||||
_logger.LogWarning("Backend process exited with code {ExitCode}.", _backendProcess.ExitCode);
|
||||
var exitCode = _backendProcess.ExitCode;
|
||||
LogStdErr($"Backend process exited unexpectedly with code {exitCode}.");
|
||||
_logger.LogError("Backend process exited unexpectedly with code {ExitCode}.", exitCode);
|
||||
Environment.ExitCode = exitCode == 0 ? 1 : exitCode;
|
||||
throw new InvalidOperationException(
|
||||
$"Backend process ended unexpectedly. Service host exit code: {Environment.ExitCode}.");
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user