From 3eedbaf66bdb85269776da06502704d828a0ecc7 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 22 Apr 2024 17:50:07 +0000 Subject: [PATCH] Fix cast error of uptime value (#50) --- src/instances.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instances.cr b/src/instances.cr index 958fecb..b4b6055 100644 --- a/src/instances.cr +++ b/src/instances.cr @@ -144,7 +144,7 @@ static_headers do |response, filepath, filestat| end SORT_PROCS = { - "health" => ->(alias : String, instance : Instance) { -(instance[:monitor]?.try &.["uptime"].as_s.to_f || 0.0) }, + "health" => ->(alias : String, instance : Instance) { -(instance[:monitor]?.try &.["uptime"].as_f || 0.0) }, "location" => ->(alias : String, instance : Instance) { instance[:region]? || "ZZ" }, "name" => ->(name : String, instance : Instance) { name }, "signup" => ->(alias : String, instance : Instance) { instance[:stats]?.try &.["openRegistrations"]?.try { |bool| bool.as_bool ? 0 : 1 } || 2 },