Invidious is an alternative front-end to YouTube
Allow channel_threads to be configured and increase pool_size
Omar Rothb3e84e27f895
diff --git a/config/config.yml b/config/config.ymlindex f8a06faa..0dc93f86 100644--- a/config/config.yml+++ b/config/config.yml@@ -1,4 +1,5 @@-pool_size: 10+pool_size: 20+channel_threads: 5threads: 5db:user: kemaldiff --git a/src/helpers.cr b/src/helpers.crindex 4fe8ae4f..4b5a77e0 100644--- a/src/helpers.cr+++ b/src/helpers.cr@@ -15,9 +15,10 @@ endclass ConfigYAML.mapping({- pool_size: Int32,- threads: Int32,- db: NamedTuple(+ pool_size: Int32,+ threads: Int32,+ channel_threads: Int32,+ db: NamedTuple(user: String,password: String,host: String,diff --git a/src/invidious.cr b/src/invidious.crindex 5437c356..37ee19c6 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -27,7 +27,7 @@ CONFIG = Config.from_yaml(File.read("config/config.yml"))pool_size = CONFIG.pool_sizethreads = CONFIG.threads-channel_threads = 10+channel_threads = CONFIG.channel_threadsKemal.config.extra_options do |parser|parser.banner = "Usage: invidious [arguments]"@@ -47,6 +47,14 @@ Kemal.config.extra_options do |parser|exitendend+ parser.on("-c THREADS", "--channel-threads=THREADS", "Number of threads for refreshing channels (default: #{channel_threads})") do |number|+ begin+ channel_threads = number.to_i+ rescue ex+ puts "THREADS must be integer"+ exit+ end+ endendKemal::CLI.new