Follow the keyvalue storage setting for things like cache and other
Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
parent
139fbab773
commit
1e757b00b4
|
@ -61,8 +61,10 @@ database:
|
||||||
cache:
|
cache:
|
||||||
# If cache is enabled or not
|
# If cache is enabled or not
|
||||||
enabled: false
|
enabled: false
|
||||||
# Cache type. Possible values are memory or redis, you'll need to enable redis below when using redis
|
# Cache type. Possible values are "keyvalue", "memory" or "redis".
|
||||||
type: memory
|
# When choosing "keyvalue" this setting follows the one configured in the "keyvalue" section.
|
||||||
|
# When choosing "redis" you will need to configure the redis connection seperately.
|
||||||
|
type: keyvalue
|
||||||
# When using memory this defines the maximum size an element can take
|
# When using memory this defines the maximum size an element can take
|
||||||
maxelementsize: 1000
|
maxelementsize: 1000
|
||||||
|
|
||||||
|
@ -136,8 +138,10 @@ ratelimit:
|
||||||
period: 60
|
period: 60
|
||||||
# The max number of requests a user is allowed to do in the configured time period
|
# The max number of requests a user is allowed to do in the configured time period
|
||||||
limit: 100
|
limit: 100
|
||||||
# The store where the limit counter for each user is stored. Possible values are "memory" or "redis"
|
# The store where the limit counter for each user is stored.
|
||||||
store: memory
|
# Possible values are "keyvalue", "memory" or "redis".
|
||||||
|
# When choosing "keyvalue" this setting follows the one configured in the "keyvalue" section.
|
||||||
|
store: keyvalue
|
||||||
|
|
||||||
files:
|
files:
|
||||||
# The path where files are stored
|
# The path where files are stored
|
||||||
|
|
|
@ -314,6 +314,14 @@ func InitConfig() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if CacheType.GetString() == "keyvalue" {
|
||||||
|
CacheType.Set(KeyvalueType.GetString())
|
||||||
|
}
|
||||||
|
|
||||||
|
if RateLimitStore.GetString() == "keyvalue" {
|
||||||
|
RateLimitStore.Set(KeyvalueType.GetString())
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("Using config file: %s", viper.ConfigFileUsed())
|
log.Printf("Using config file: %s", viper.ConfigFileUsed())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue