mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-19 03:26:57 +00:00
Move redis config to CacheConfig struct, add cache prefixes & trace logging
This commit is contained in:
parent
e1a22d5f4c
commit
46c8daacba
7 changed files with 45 additions and 30 deletions
|
@ -6,7 +6,7 @@ type Config struct {
|
|||
Gitea GiteaConfig
|
||||
Database DatabaseConfig
|
||||
ACME ACMEConfig
|
||||
RedisURL string `default:""`
|
||||
Cache CacheConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
|
@ -46,3 +46,7 @@ type ACMEConfig struct {
|
|||
NoDNS01 bool `default:"false"`
|
||||
AccountConfigFile string `default:"acme-account.json"`
|
||||
}
|
||||
|
||||
type CacheConfig struct {
|
||||
RedisURL string `default:""`
|
||||
}
|
||||
|
|
|
@ -54,9 +54,7 @@ func MergeConfig(ctx *cli.Context, config *Config) {
|
|||
mergeGiteaConfig(ctx, &config.Gitea)
|
||||
mergeDatabaseConfig(ctx, &config.Database)
|
||||
mergeACMEConfig(ctx, &config.ACME)
|
||||
if ctx.IsSet("redis-url") {
|
||||
config.RedisURL = ctx.String("redis-url")
|
||||
}
|
||||
mergeCacheConfig(ctx, &config.Cache)
|
||||
}
|
||||
|
||||
func mergeServerConfig(ctx *cli.Context, config *ServerConfig) {
|
||||
|
@ -151,3 +149,9 @@ func mergeACMEConfig(ctx *cli.Context, config *ACMEConfig) {
|
|||
config.AccountConfigFile = ctx.String("acme-account-config")
|
||||
}
|
||||
}
|
||||
|
||||
func mergeCacheConfig(ctx *cli.Context, config *CacheConfig) {
|
||||
if ctx.IsSet("redis-url") {
|
||||
config.RedisURL = ctx.String("redis-url")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue