From 0e888b0857472a82d454f5d074574ae75322ba5a Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 27 Sep 2019 08:34:52 -0400 Subject: [PATCH] Fix typo in monitor handling --- src/instances.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/instances.cr b/src/instances.cr index 62e84f5..6def7af 100644 --- a/src/instances.cr +++ b/src/instances.cr @@ -49,6 +49,7 @@ spawn do error_message = response.try &.["errorStats"]? error_message ||= ex.message puts "Exception pulling monitors: #{error_message}" + break end end @@ -78,7 +79,7 @@ spawn do end monitor = monitors.try &.select { |monitor| monitor["name"].try &.as_s == host }[0]? - INSTANCES[host] = {flag: flag, region: region, stats: stats, type: type, uri: uri.to_s, monitor: monitor} + INSTANCES[host] = {flag: flag, region: region, stats: stats, type: type, uri: uri.to_s, monitor: monitor || INSTANCES[host]?.try &.[:monitor]?} end sleep 5.minutes