From e6c844708191a52363140b60dfb89e5b60711644 Mon Sep 17 00:00:00 2001 From: Paul Louth Date: Tue, 12 Oct 2021 21:08:26 +0100 Subject: [PATCH] Role dispatchers have a 24 hour timeout --- Echo.Process/Role.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Echo.Process/Role.cs b/Echo.Process/Role.cs index 5b75689..c5be50d 100644 --- a/Echo.Process/Role.cs +++ b/Echo.Process/Role.cs @@ -189,8 +189,13 @@ public static ProcessName Current public static IEnumerable NodeIds(ProcessId leaf) => Nodes(leaf).Values.Map(node => ProcessId.Top[node.NodeName].Append(leaf.Skip(1))); - public static HashMap Nodes(ProcessId leaf, SystemName system = default(SystemName)) => - ClusterNodes24(system).Filter(node => node.Role == leaf.Take(1).Name); + public static HashMap Nodes(ProcessId leaf, SystemName system = default(SystemName)) + { + var nodes = ClusterNodes(system).Filter(node => node.Role == leaf.Take(1).Name); + return nodes.Count == 0 + ? ClusterNodes24(system).Filter(node => node.Role == leaf.Take(1).Name) + : nodes; + } static readonly ProcessId nextRoot; static readonly ProcessId prevRoot;