diff options
| author | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-01 01:15:08 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-01 01:15:08 +0300 |
| commit | d9e07aff4a8160de7ce19ea536e69ed8f9a7a6d5 (patch) | |
| tree | 6ad11fe2752c2b3e928010818bfccde62c5be9a9 /Software/Visual_Studio | |
| parent | 76a913a9d3e70f4379c3aaca7e6dd8e4da6aff13 (diff) | |
| download | Tango-d9e07aff4a8160de7ce19ea536e69ed8f9a7a6d5.tar.gz Tango-d9e07aff4a8160de7ce19ea536e69ed8f9a7a6d5.zip | |
IoT hub Destination Fix.
Diffstat (limited to 'Software/Visual_Studio')
3 files changed, 11 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.Telemetry/Destinations/TelemetryAzureHubDestination.cs b/Software/Visual_Studio/Tango.Telemetry/Destinations/TelemetryAzureHubDestination.cs index 61a4bd880..349655c54 100644 --- a/Software/Visual_Studio/Tango.Telemetry/Destinations/TelemetryAzureHubDestination.cs +++ b/Software/Visual_Studio/Tango.Telemetry/Destinations/TelemetryAzureHubDestination.cs @@ -131,6 +131,11 @@ namespace Tango.Telemetry.Destinations { HubConnectionStatus = status; LogManager.Log($"IoT hub status changed to: {status}, Reason: {reason}.", LogCategory.Info); + + if (status == ConnectionStatus.Disabled || status == ConnectionStatus.Disconnected) + { + _hubClient = null; + } }); } diff --git a/Software/Visual_Studio/Tango.Telemetry/Helpers/DateTimeUTCFixer.cs b/Software/Visual_Studio/Tango.Telemetry/Helpers/DateTimeUTCFixer.cs index 3ce0c700f..ace9f51a5 100644 --- a/Software/Visual_Studio/Tango.Telemetry/Helpers/DateTimeUTCFixer.cs +++ b/Software/Visual_Studio/Tango.Telemetry/Helpers/DateTimeUTCFixer.cs @@ -27,6 +27,7 @@ namespace Tango.Telemetry.Helpers private static void EnsureUtcInternal(object obj, HashSet<object> visited) { if (obj == null) return; + if (obj is Google.Protobuf.IMessage) return; var type = obj.GetType(); diff --git a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs index eb4ba57f1..07b421406 100644 --- a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs +++ b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs @@ -687,7 +687,7 @@ namespace Tango.Telemetry result.DestinationsResults.Add(destinationResult); // If we're still in a backoff delay, skip for now - if (now < pendingEntry.NextEligibleAttempt) + if (Config.EnableBackoff && now < pendingEntry.NextEligibleAttempt) { destinationResult.Status = TelemetryPublishResult.DestinationStatus.Postponed; destinationResult.ElapsedTime = TimeSpan.Zero; @@ -865,7 +865,10 @@ namespace Tango.Telemetry } } - LogManager.Log("FlushPendingTelemetries completed successfully.", LogCategory.Info); + if (results.Any(x => x.DestinationsResults.Any(y => y.Status == TelemetryPublishResult.DestinationStatus.Passed))) + { + LogManager.Log("FlushPendingTelemetries completed successfully.", LogCategory.Info); + } } return results; |
