refactor: update config and readme

This commit is contained in:
krau
2024-11-09 09:43:56 +08:00
parent 0297fdce71
commit 3e5cd60cf7
3 changed files with 12 additions and 9 deletions

View File

@@ -8,9 +8,7 @@ import (
)
type Config struct {
Threads int `toml:"threads" mapstructure:"threads"`
Workers int `toml:"workers" mapstructure:"workers"`
ChunkSize int32 `toml:"chunk_size" mapstructure:"chunk_size"`
Workers int `toml:"workers" mapstructure:"workers"`
Temp tempConfig `toml:"temp" mapstructure:"temp"`
Log logConfig `toml:"log" mapstructure:"log"`
@@ -76,9 +74,7 @@ func Init() {
viper.AddConfigPath(".")
viper.SetConfigType("toml")
viper.SetDefault("threads", 3)
viper.SetDefault("workers", 3)
viper.SetDefault("chunk_size", 1024*1024)
viper.SetDefault("temp.base_path", "cache/")
viper.SetDefault("temp.cache_ttl", 3600)