Add check for application shutdown when waiting for debugger

This commit is contained in:
Matija Koželj 2023-01-05 14:26:47 +01:00
parent 9d22093165
commit 3dc20a9325

View File

@ -18,7 +18,7 @@ internal sealed class ConnectedPlatformService : BackgroundService
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
if (GlobalConfig.GetValue<bool>("waitForDebugger"))
while (!Debugger.IsAttached)
while (!Debugger.IsAttached && !stoppingToken.IsCancellationRequested)
await Task.Delay(500);
await DependencyLoader.LoadPackages(Config.MicroServices, Config.Repositories);