Forráskód Böngészése

确保进程停止

老九 3 éve
szülő
commit
1053c3aebd
1 módosított fájl, 4 hozzáadás és 1 törlés
  1. 4 1
      FastGithub/AppHostedService.cs

+ 4 - 1
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);
+            }
         }
 
     }