mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-30 02:32:56 +05:30
Fix invalid logic for instance uptime comparison
This commit is contained in:
parent
41c978d350
commit
aa96cf3453
@ -69,7 +69,7 @@ class Invidious::Jobs::InstanceListRefreshJob < Invidious::Jobs::BaseJob
|
|||||||
|
|
||||||
raw_instance_list = JSON.parse(instance_api_client.get("/instances.json").body).as_a
|
raw_instance_list = JSON.parse(instance_api_client.get("/instances.json").body).as_a
|
||||||
instance_api_client.close
|
instance_api_client.close
|
||||||
rescue Socket::ConnectError | IO::TimeoutError | JSON::ParseException
|
rescue ex : Socket::ConnectError | IO::TimeoutError | JSON::ParseException
|
||||||
raw_instance_list = [] of JSON::Any
|
raw_instance_list = [] of JSON::Any
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -89,9 +89,9 @@ class Invidious::Jobs::InstanceListRefreshJob < Invidious::Jobs::BaseJob
|
|||||||
|
|
||||||
# Checks if the uptime of the target instance is greater than 90% over a 30 day period
|
# Checks if the uptime of the target instance is greater than 90% over a 30 day period
|
||||||
private def bad_uptime?(target_instance_health_monitor) : Bool
|
private def bad_uptime?(target_instance_health_monitor) : Bool
|
||||||
return false if !target_instance_health_monitor["statusClass"] == "success"
|
return true if !target_instance_health_monitor["statusClass"] == "success"
|
||||||
return false if target_instance_health_monitor["30dRatio"]["ratio"].as_s.to_f < 90
|
return true if target_instance_health_monitor["30dRatio"]["ratio"].as_s.to_f < 90
|
||||||
|
|
||||||
return true
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user