diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-04-09 22:07:09 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-04-09 22:07:09 -0500 |
| commit | b3e84e27f895a8ae21142f3a78b1c42f57888a0a (patch) | |
| tree | b5a11f06996c614f6f60f1b2834239d0ab3d5879 /src | |
| parent | e8349ae46b4ef8cda0f106fec09fc2da64c16c91 (diff) | |
| download | invidious-b3e84e27f895a8ae21142f3a78b1c42f57888a0a.tar.gz invidious-b3e84e27f895a8ae21142f3a78b1c42f57888a0a.tar.bz2 invidious-b3e84e27f895a8ae21142f3a78b1c42f57888a0a.zip | |
Allow channel_threads to be configured and increase pool_size
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers.cr | 7 | ||||
| -rw-r--r-- | src/invidious.cr | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/helpers.cr b/src/helpers.cr index 4fe8ae4f..4b5a77e0 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -15,9 +15,10 @@ end class Config YAML.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.cr index 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_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 |
