mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Allow channel_threads to be configured and increase pool_size
This commit is contained in:
parent
e8349ae46b
commit
b3e84e27f8
3 changed files with 15 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
pool_size: 10
|
pool_size: 20
|
||||||
|
channel_threads: 5
|
||||||
threads: 5
|
threads: 5
|
||||||
db:
|
db:
|
||||||
user: kemal
|
user: kemal
|
||||||
|
|
|
@ -15,9 +15,10 @@ end
|
||||||
|
|
||||||
class Config
|
class Config
|
||||||
YAML.mapping({
|
YAML.mapping({
|
||||||
pool_size: Int32,
|
pool_size: Int32,
|
||||||
threads: Int32,
|
threads: Int32,
|
||||||
db: NamedTuple(
|
channel_threads: Int32,
|
||||||
|
db: NamedTuple(
|
||||||
user: String,
|
user: String,
|
||||||
password: String,
|
password: String,
|
||||||
host: String,
|
host: String,
|
||||||
|
|
|
@ -27,7 +27,7 @@ CONFIG = Config.from_yaml(File.read("config/config.yml"))
|
||||||
|
|
||||||
pool_size = CONFIG.pool_size
|
pool_size = CONFIG.pool_size
|
||||||
threads = CONFIG.threads
|
threads = CONFIG.threads
|
||||||
channel_threads = 10
|
channel_threads = CONFIG.channel_threads
|
||||||
|
|
||||||
Kemal.config.extra_options do |parser|
|
Kemal.config.extra_options do |parser|
|
||||||
parser.banner = "Usage: invidious [arguments]"
|
parser.banner = "Usage: invidious [arguments]"
|
||||||
|
@ -47,6 +47,14 @@ Kemal.config.extra_options do |parser|
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
Kemal::CLI.new
|
Kemal::CLI.new
|
||||||
|
|
Loading…
Reference in a new issue