From 1053c3aebd5a6c4d2f4d6699c5d4e95eb8b420d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E4=B9=9D?= <366193849@qq.com> Date: Mon, 1 Nov 2021 21:25:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E8=BF=9B=E7=A8=8B=E5=81=9C?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub/AppHostedService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); + } } }