diff --git a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs index d508d94..39fe1f8 100644 --- a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs +++ b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs @@ -13,8 +13,8 @@ namespace CriticalPathAnalyzer.Client.Tool { public class CriticalPathAnalyzerTool { private static ILogicLogger _logger; - private static PegAddress? _startPegAddress; - private static PegAddress? _endPegAddress; + private static PegAddress _startPegAddress = PegAddress.Empty; + private static PegAddress _endPegAddress = PegAddress.Empty; private static Guid _currentRequestGuid = Guid.NewGuid(); private static AnalyzePathResponse _response; @@ -24,8 +24,8 @@ namespace CriticalPathAnalyzer.Client.Tool { } public static void Clear() { - _startPegAddress = null; - _endPegAddress = null; + _startPegAddress = PegAddress.Empty; + _endPegAddress = PegAddress.Empty; PathHighLighter.RemoveHighLighting(); } @@ -86,7 +86,7 @@ namespace CriticalPathAnalyzer.Client.Tool { } private static void CalculateCriticalPath() { - if (_startPegAddress == null || _endPegAddress == null) { + if (_startPegAddress.IsEmpty() || _endPegAddress.IsEmpty()) { _logger.Error("Invalid pegs"); return; } @@ -94,8 +94,8 @@ namespace CriticalPathAnalyzer.Client.Tool { _currentRequestGuid = Guid.NewGuid(); Instances.SendData.Send(new AnalyzePathRequest { RequestGuid = _currentRequestGuid, - StartPegAddress = _startPegAddress.Value, - EndPegAddress = _endPegAddress.Value, + StartPegAddress = _startPegAddress, + EndPegAddress = _endPegAddress, }); } diff --git a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs index 559fbbd..df7f69c 100644 --- a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs +++ b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs @@ -98,7 +98,7 @@ namespace CriticalPathAnalyzer.Server.Tool { int iters = 0; while (queue.TryDequeue(out ClusterNode node)) { iters++; - if (iters > 1000) { + if (iters > 10000) { logger.Error("Infinite iterations"); break; } @@ -129,6 +129,8 @@ namespace CriticalPathAnalyzer.Server.Tool { loopingNodes.Add(node.Index); loopingNodes.Add(nextNode.Index); // already been here - there is a cycle + // TODO: this doesn't work - if cluster A is updated by cluster B, + // TODO: and cluster B is updated by clusters C and D, it detects a cycle where isn't one continue; }