mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-31 05:01:06 +08:00
feat: configurable download threads and workers
This commit is contained in:
@@ -8,6 +8,9 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Threads int `toml:"threads" mapstructure:"threads"`
|
||||
Workers int `toml:"workers" mapstructure:"workers"`
|
||||
|
||||
Temp tempConfig `toml:"temp" mapstructure:"temp"`
|
||||
Log logConfig `toml:"log" mapstructure:"log"`
|
||||
DB dbConfig `toml:"db" mapstructure:"db"`
|
||||
@@ -72,6 +75,9 @@ func Init() {
|
||||
viper.AddConfigPath(".")
|
||||
viper.SetConfigType("toml")
|
||||
|
||||
viper.SetDefault("threads", 3)
|
||||
viper.SetDefault("workers", 3)
|
||||
|
||||
viper.SetDefault("temp.base_path", "cache/")
|
||||
viper.SetDefault("temp.cache_ttl", 3600)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user