diff --git a/FastGithub/AppHostedService.cs b/FastGithub/AppHostedService.cs index 1900129..fe326bc 100644 --- a/FastGithub/AppHostedService.cs +++ b/FastGithub/AppHostedService.cs @@ -142,12 +142,15 @@ namespace FastGithub try { Process.GetProcessById(parentId).WaitForExit(); - await this.host.StopAsync(cancellationToken); } catch (Exception ex) { this.logger.LogError(ex, $"获取进程{parentId}异常"); } + finally + { + await this.host.StopAsync(cancellationToken); + } } }