2020-10-17 12:25:57 +00:00
|
|
|
class Invidious::Jobs::UpdateDecryptFunctionJob < Invidious::Jobs::BaseJob
|
2020-09-27 17:19:44 +00:00
|
|
|
private getter logger : Invidious::LogHandler
|
|
|
|
|
|
|
|
def initialize(@logger)
|
|
|
|
end
|
2020-10-17 12:25:57 +00:00
|
|
|
|
|
|
|
def begin
|
|
|
|
loop do
|
|
|
|
begin
|
2020-09-27 17:19:44 +00:00
|
|
|
DECRYPT_FUNCTION.update_decrypt_function
|
2020-10-17 12:25:57 +00:00
|
|
|
rescue ex
|
2020-09-27 17:19:44 +00:00
|
|
|
logger.error("UpdateDecryptFunctionJob : #{ex.message}")
|
2020-10-17 12:25:57 +00:00
|
|
|
ensure
|
|
|
|
sleep 1.minute
|
|
|
|
Fiber.yield
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|