Fix typo in monitor handling

This commit is contained in:
Omar Roth 2019-09-27 08:34:52 -04:00
parent 4453c26112
commit 0e888b0857
No known key found for this signature in database
GPG Key ID: B8254FB7EC3D37F2
1 changed files with 2 additions and 1 deletions

View File

@ -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