chore: add check backends interval configuration option

This commit is contained in:
Fijxu 2025-03-16 23:10:19 -03:00
parent facd01b52e
commit a44f37563b
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
2 changed files with 4 additions and 2 deletions

View file

@ -237,6 +237,8 @@ class Config
property lru_max_size : Int32 = 18432 # ~512MB
end
property check_backends_interval : Int32 = 30
{% if flag?(:linux) %}
property reload_config_automatically : Bool = true
{% end %}

View file

@ -5,8 +5,8 @@ class Invidious::Jobs::CheckBackend < Invidious::Jobs::BaseJob
def begin
loop do
BackendInfo.check_backends
LOGGER.info("Backend Checker: Done, sleeping for 30 seconds")
sleep 30.seconds
LOGGER.info("Backend Checker: Done, sleeping for #{CONFIG.check_backends_interval} seconds")
sleep CONFIG.check_backends_interval.seconds
Fiber.yield
end
end