|
|
@@ -43,7 +43,7 @@ namespace HealthMonitor.WebApi |
|
|
|
|
|
|
|
protected override Task ExecuteAsync(CancellationToken stoppingToken) |
|
|
|
{ |
|
|
|
// var processor = _services.GetService<PackageProcess>(); |
|
|
|
// var processor = _services.GetService<PackageProcess>(); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|