mirror of
https://github.com/iv-org/instances-api.git
synced 2024-11-26 23:20:22 +00:00
Fix cast error of uptime value (#50)
This commit is contained in:
parent
88bb7ecfaa
commit
3eedbaf66b
@ -144,7 +144,7 @@ static_headers do |response, filepath, filestat|
|
|||||||
end
|
end
|
||||||
|
|
||||||
SORT_PROCS = {
|
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" },
|
"location" => ->(alias : String, instance : Instance) { instance[:region]? || "ZZ" },
|
||||||
"name" => ->(name : String, instance : Instance) { name },
|
"name" => ->(name : String, instance : Instance) { name },
|
||||||
"signup" => ->(alias : String, instance : Instance) { instance[:stats]?.try &.["openRegistrations"]?.try { |bool| bool.as_bool ? 0 : 1 } || 2 },
|
"signup" => ->(alias : String, instance : Instance) { instance[:stats]?.try &.["openRegistrations"]?.try { |bool| bool.as_bool ? 0 : 1 } || 2 },
|
||||||
|
Loading…
Reference in New Issue
Block a user