From b0b8ba7000e76e7d5632e9edfebf5c8c4aa44111 Mon Sep 17 00:00:00 2001 From: saltycrys <73420320+saltycrys@users.noreply.github.com> Date: Thu, 7 Jan 2021 20:15:26 +0100 Subject: [PATCH] Respect `use_pubsub_feeds` config Setting `use_pubsub_feeds: false` now properly disables it. --- src/invidious.cr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 2b915350..800ea956 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -169,7 +169,6 @@ end Invidious::Jobs.register Invidious::Jobs::RefreshChannelsJob.new(PG_DB, config) Invidious::Jobs.register Invidious::Jobs::RefreshFeedsJob.new(PG_DB, config) -Invidious::Jobs.register Invidious::Jobs::SubscribeToFeedsJob.new(PG_DB, config, HMAC_KEY) DECRYPT_FUNCTION = DecryptFunction.new(CONFIG.decrypt_polling) if config.decrypt_polling @@ -180,6 +179,10 @@ if config.statistics_enabled Invidious::Jobs.register Invidious::Jobs::StatisticsRefreshJob.new(PG_DB, config, SOFTWARE) end +if (config.use_pubsub_feeds.is_a?(Bool) && config.use_pubsub_feeds.as(Bool)) || (config.use_pubsub_feeds.is_a?(Int32) && config.use_pubsub_feeds.as(Int32) > 0) + Invidious::Jobs.register Invidious::Jobs::SubscribeToFeedsJob.new(PG_DB, config, HMAC_KEY) +end + if config.popular_enabled Invidious::Jobs.register Invidious::Jobs::PullPopularVideosJob.new(PG_DB) end