diff --git a/HealthMonitor.WebApi/Dockerfile b/HealthMonitor.WebApi/Dockerfile index 4ed6945..0b204e2 100644 --- a/HealthMonitor.WebApi/Dockerfile +++ b/HealthMonitor.WebApi/Dockerfile @@ -42,5 +42,5 @@ ENV LANG C.UTF-8 RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone #ENTRYPOINT dotnet HealthMonitor.WebApi.dll --environment=$environment -ENTRYPOINT ["dotnet", "HealthMonitor.WebAapi.dll"] +ENTRYPOINT ["dotnet", "HealthMonitor.WebApi.dll"] CMD ["--environment=Development"] \ No newline at end of file diff --git a/HealthMonitor.WebApi/Properties/launchSettings.json b/HealthMonitor.WebApi/Properties/launchSettings.json index 5077478..cbd8185 100644 --- a/HealthMonitor.WebApi/Properties/launchSettings.json +++ b/HealthMonitor.WebApi/Properties/launchSettings.json @@ -13,8 +13,9 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - // "launchUrl": "swagger", - "applicationUrl": "https://localhost:7149;http://localhost:5083", + // "launchUrl": "swagger", + //"applicationUrl": "https://localhost:7149;http://localhost:5083", + "applicationUrl": "http://localhost:6899", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/HealthMonitor.WebApi/Worker.cs b/HealthMonitor.WebApi/Worker.cs index 716b46e..a459e21 100644 --- a/HealthMonitor.WebApi/Worker.cs +++ b/HealthMonitor.WebApi/Worker.cs @@ -43,7 +43,7 @@ namespace HealthMonitor.WebApi protected override Task ExecuteAsync(CancellationToken stoppingToken) { - // var processor = _services.GetService(); + // var processor = _services.GetService(); TaskFactory factory = new(_tokenSource.Token); factory.StartNew(async () => { @@ -52,16 +52,21 @@ namespace HealthMonitor.WebApi while (!_tokenSource.IsCancellationRequested) { + await _processor.ResolveAsync().ConfigureAwait(false); - // await _tdEngineDataSubcribe.ProcessMsg(); + // await _tdEngineDataSubcribe.ProcessMsg(); } }, TaskCreationOptions.LongRunning); - while (!_tokenSource.IsCancellationRequested) + factory.StartNew(() => { - _tdEngineDataSubcribe.BeginListen(_tokenSource.Token); - } + while (!_tokenSource.IsCancellationRequested) + { + _tdEngineDataSubcribe.BeginListen(_tokenSource.Token); + } + }, TaskCreationOptions.LongRunning); + return Task.Delay(1000, _tokenSource.Token); }