Fix: NucuCar.Sensors creating a telemetry singleton when telemetry is disabled
This commit is contained in:
parent
8434d4f519
commit
d703b53a6b
1 changed files with 4 additions and 1 deletions
|
@ -18,8 +18,11 @@ namespace NucuCar.Sensors.Telemetry
|
|||
_serviceEnabled = configuration.GetValue<bool>("Telemetry:Enabled");
|
||||
_interval = configuration.GetValue<int>("Telemetry:Interval");
|
||||
var azureIotHubConnectionString = configuration.GetValue<string>("Telemetry:AzureIotHubConnectionString");
|
||||
if (_serviceEnabled)
|
||||
{
|
||||
SensorTelemetryPublisher.CreateSingleton(azureIotHubConnectionString, "NucuCar.Sensors", logger);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue