mirror of
https://github.com/alibaba/higress.git
synced 2026-06-06 11:17:29 +08:00
Add database configuration for plugins that use Redis. (#1814)
This commit is contained in:
@@ -52,6 +52,9 @@ type ProviderConfig struct {
|
||||
// @Title 缓存 Key 前缀
|
||||
// @Description 缓存 Key 的前缀,默认值为 "higressAiCache:"
|
||||
cacheKeyPrefix string
|
||||
// @Title redis database
|
||||
// @Description 指定 redis 的 database,默认使用0
|
||||
database int
|
||||
}
|
||||
|
||||
func (c *ProviderConfig) GetProviderType() string {
|
||||
@@ -79,6 +82,7 @@ func (c *ProviderConfig) FromJson(json gjson.Result) {
|
||||
if !json.Get("password").Exists() {
|
||||
c.password = ""
|
||||
}
|
||||
c.database = int(json.Get("database").Int())
|
||||
c.timeout = uint32(json.Get("timeout").Int())
|
||||
if !json.Get("timeout").Exists() {
|
||||
c.timeout = 10000
|
||||
|
||||
Reference in New Issue
Block a user