From 1d8115b0221779497d2cf33378b970b04a833d03 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 1 Sep 2025 02:33:22 +0300 Subject: Fixed telemetry logs cyclic loop --- Software/Visual_Studio/PPC/Tango.PPC.UI/App.config | 5 +++++ .../PPC/Tango.PPC.UI/Telemetry/DefaultTelemetryProvider.cs | 1 + Software/Visual_Studio/Tango.Telemetry/ITelemetryStorageManager.cs | 2 +- .../Tango.Telemetry/Sources/TelemetryLogsStreamingSource.cs | 2 ++ .../Visual_Studio/Tango.Telemetry/TelemetryLiteDBStorageManager.cs | 1 + Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config index 53a599bee..8539cda46 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config @@ -135,6 +135,11 @@ + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Telemetry/DefaultTelemetryProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Telemetry/DefaultTelemetryProvider.cs index 31646c709..6d72e618c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Telemetry/DefaultTelemetryProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Telemetry/DefaultTelemetryProvider.cs @@ -231,6 +231,7 @@ namespace Tango.PPC.UI.Telemetry public void Dispose() { TelemetryPublisher?.Dispose(); + TelemetryPublisher?.StorageManager.Dispose(); } } } diff --git a/Software/Visual_Studio/Tango.Telemetry/ITelemetryStorageManager.cs b/Software/Visual_Studio/Tango.Telemetry/ITelemetryStorageManager.cs index 882cc0411..9376f6adf 100644 --- a/Software/Visual_Studio/Tango.Telemetry/ITelemetryStorageManager.cs +++ b/Software/Visual_Studio/Tango.Telemetry/ITelemetryStorageManager.cs @@ -9,7 +9,7 @@ namespace Tango.Telemetry /// /// Defines the contract for managing telemetry storage, including pending telemetries and history source checkpoints. /// - public interface ITelemetryStorageManager + public interface ITelemetryStorageManager : IDisposable { /// /// Initializes the storage manager with the specified checkpoints recovery client. diff --git a/Software/Visual_Studio/Tango.Telemetry/Sources/TelemetryLogsStreamingSource.cs b/Software/Visual_Studio/Tango.Telemetry/Sources/TelemetryLogsStreamingSource.cs index 2c8020f7c..2f592f22a 100644 --- a/Software/Visual_Studio/Tango.Telemetry/Sources/TelemetryLogsStreamingSource.cs +++ b/Software/Visual_Studio/Tango.Telemetry/Sources/TelemetryLogsStreamingSource.cs @@ -64,6 +64,8 @@ namespace Tango.Telemetry.Sources if (IsStarted) { if (!Config.Categories.Contains(log.Category)) return; + if (log.ClassName != null && log.ClassName.StartsWith("Telemetry")) return; + TelemetryLog tLog = LogMapper.MapLog(log); TelemetryAvailable?.Invoke(this, new TelemetryAvailableEventArgs() { TelemetryObject = tLog }); diff --git a/Software/Visual_Studio/Tango.Telemetry/TelemetryLiteDBStorageManager.cs b/Software/Visual_Studio/Tango.Telemetry/TelemetryLiteDBStorageManager.cs index ab0ff2b58..13781d6dc 100644 --- a/Software/Visual_Studio/Tango.Telemetry/TelemetryLiteDBStorageManager.cs +++ b/Software/Visual_Studio/Tango.Telemetry/TelemetryLiteDBStorageManager.cs @@ -251,6 +251,7 @@ namespace Tango.Telemetry try { _disposed = true; + _database.Checkpoint(); _database.Dispose(); _database = null; } diff --git a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs index 07b421406..8c05524ed 100644 --- a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs +++ b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs @@ -1008,6 +1008,7 @@ namespace Tango.Telemetry { try { + Debug.WriteLine($"[TELEMETRY] Package Publish Result Available: {result}"); PublishResultAvailable?.Invoke(this, new TelemetryPublishResultAvailableEventArgs() { Package = package, PublishResult = result }); } catch { } -- cgit v1.3.1