RemoteCache: Refactor remote cache settings (#95672)

* refactor remote cache settings

* fix cache error getting treating as application error

* fix cache error getting treating as application error
This commit is contained in:
Jo
2024-11-04 17:35:31 +01:00
committed by GitHub
parent 85c696c4ad
commit ddf766567b
11 changed files with 37 additions and 33 deletions
+23
View File
@@ -0,0 +1,23 @@
package setting
type RemoteCacheSettings struct {
Name string
ConnStr string
Prefix string
Encryption bool
}
func (cfg *Cfg) readRemoteCacheSettings() {
cacheServer := cfg.Raw.Section("remote_cache")
dbName := valueAsString(cacheServer, "type", "database")
connStr := valueAsString(cacheServer, "connstr", "")
prefix := valueAsString(cacheServer, "prefix", "")
encryption := cacheServer.Key("encryption").MustBool(false)
cfg.RemoteCacheOptions = &RemoteCacheSettings{
Name: dbName,
ConnStr: connStr,
Prefix: prefix,
Encryption: encryption,
}
}