summaryrefslogtreecommitdiffstats
path: root/src/invidious.cr
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-10-09 17:24:29 -0500
committerOmar Roth <omarroth@hotmail.com>2018-10-09 17:24:29 -0500
commitbcc8ba73bf8d6f4d2ee9083927f6991ce3f15bd3 (patch)
tree7f822b94fcbb51292283a561d8975bf13fbfb248 /src/invidious.cr
parent35e63fa3f5472f847044499ce6d2c6a44220ce07 (diff)
downloadinvidious-bcc8ba73bf8d6f4d2ee9083927f6991ce3f15bd3.tar.gz
invidious-bcc8ba73bf8d6f4d2ee9083927f6991ce3f15bd3.tar.bz2
invidious-bcc8ba73bf8d6f4d2ee9083927f6991ce3f15bd3.zip
Fix update_feeds job
Diffstat (limited to 'src/invidious.cr')
-rw-r--r--src/invidious.cr17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 4ba4f960..5f7cec7a 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -31,6 +31,7 @@ HMAC_KEY = CONFIG.hmac_key || Random::Secure.random_bytes(32)
crawl_threads = CONFIG.crawl_threads
channel_threads = CONFIG.channel_threads
+feed_threads = CONFIG.feed_threads
video_threads = CONFIG.video_threads
Kemal.config.extra_options do |parser|
@@ -51,6 +52,14 @@ Kemal.config.extra_options do |parser|
exit
end
end
+ parser.on("-f THREADS", "--feed-threads=THREADS", "Number of threads for refreshing feeds (default: #{feed_threads})") do |number|
+ begin
+ feed_threads = number.to_i
+ rescue ex
+ puts "THREADS must be integer"
+ exit
+ end
+ end
parser.on("-v THREADS", "--video-threads=THREADS", "Number of threads for refreshing videos (default: #{video_threads})") do |number|
begin
video_threads = number.to_i
@@ -85,6 +94,8 @@ end
refresh_channels(PG_DB, channel_threads, CONFIG.full_refresh)
+refresh_feeds(PG_DB, feed_threads)
+
video_threads.times do |i|
spawn do
refresh_videos(PG_DB)
@@ -98,12 +109,6 @@ spawn do
end
end
-if CONFIG.update_feeds
- spawn do
- update_feeds(PG_DB)
- end
-end
-
decrypt_function = [] of {name: String, value: Int32}
spawn do
update_decrypt_function do |function|