确保进程停止

This commit is contained in:
老九 2021-11-01 21:25:42 +08:00
parent 1efc342a46
commit 1053c3aebd

View File

@ -142,12 +142,15 @@ namespace FastGithub
try try
{ {
Process.GetProcessById(parentId).WaitForExit(); Process.GetProcessById(parentId).WaitForExit();
await this.host.StopAsync(cancellationToken);
} }
catch (Exception ex) catch (Exception ex)
{ {
this.logger.LogError(ex, $"获取进程{parentId}异常"); this.logger.LogError(ex, $"获取进程{parentId}异常");
} }
finally
{
await this.host.StopAsync(cancellationToken);
}
} }
} }