summaryrefslogtreecommitdiffstats
path: root/src/invidious.cr
diff options
context:
space:
mode:
authorPerflyst <mail@perflyst.de>2021-01-05 19:32:22 +0100
committerGitHub <noreply@github.com>2021-01-05 19:32:22 +0100
commit2c24bf3222e6f52e4aaad1db4ce446675201ff49 (patch)
treebc065dd593f423de46914a34be6882e6c809c926 /src/invidious.cr
parente036d89a86cb7ab2d65ec2a9c3ea654c9774e70e (diff)
parent3a2bd4e928382a4fbb70d1f978912c72b8f889fe (diff)
downloadinvidious-2c24bf3222e6f52e4aaad1db4ce446675201ff49.tar.gz
invidious-2c24bf3222e6f52e4aaad1db4ce446675201ff49.tar.bz2
invidious-2c24bf3222e6f52e4aaad1db4ce446675201ff49.zip
Merge pull request #1389 from vhuynh3000/decrypt_on_demand
add config to decrypt on demand instead of polling
Diffstat (limited to 'src/invidious.cr')
-rw-r--r--src/invidious.cr8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 1d2125cb..5d19acf1 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -168,7 +168,11 @@ end
Invidious::Jobs.register Invidious::Jobs::RefreshChannelsJob.new(PG_DB, logger, config)
Invidious::Jobs.register Invidious::Jobs::RefreshFeedsJob.new(PG_DB, logger, config)
Invidious::Jobs.register Invidious::Jobs::SubscribeToFeedsJob.new(PG_DB, logger, config, HMAC_KEY)
-Invidious::Jobs.register Invidious::Jobs::UpdateDecryptFunctionJob.new
+
+DECRYPT_FUNCTION = DecryptFunction.new(CONFIG.decrypt_polling)
+if config.decrypt_polling
+ Invidious::Jobs.register Invidious::Jobs::UpdateDecryptFunctionJob.new(logger)
+end
if config.statistics_enabled
Invidious::Jobs.register Invidious::Jobs::StatisticsRefreshJob.new(PG_DB, config, SOFTWARE)
@@ -191,8 +195,6 @@ def popular_videos
Invidious::Jobs::PullPopularVideosJob::POPULAR_VIDEOS.get
end
-DECRYPT_FUNCTION = Invidious::Jobs::UpdateDecryptFunctionJob::DECRYPT_FUNCTION
-
before_all do |env|
preferences = begin
Preferences.from_json(env.request.cookies["PREFS"]?.try &.value || "{}")