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