Allow channel_threads to be configured and increase pool_size

pull/3/head
Omar Roth 7 years ago
parent e8349ae46b
commit b3e84e27f8

@ -1,4 +1,5 @@
pool_size: 10
pool_size: 20
channel_threads: 5
threads: 5
db:
user: kemal

@ -17,6 +17,7 @@ class Config
YAML.mapping({
pool_size: Int32,
threads: Int32,
channel_threads: Int32,
db: NamedTuple(
user: String,
password: String,

@ -27,7 +27,7 @@ CONFIG = Config.from_yaml(File.read("config/config.yml"))
pool_size = CONFIG.pool_size
threads = CONFIG.threads
channel_threads = 10
channel_threads = CONFIG.channel_threads
Kemal.config.extra_options do |parser|
parser.banner = "Usage: invidious [arguments]"
@ -47,6 +47,14 @@ Kemal.config.extra_options do |parser|
exit
end
end
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
end
end
Kemal::CLI.new

Loading…
Cancel
Save