Skip to content

Commit

Permalink
fix: default port of static service in ai-cache plugin (alibaba#1591)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirror58229 authored and yunmaoQu committed Dec 25, 2024
1 parent 007281f commit 536ee37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/wasm-go/extensions/ai-cache/cache/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cache

import (
"errors"
"strings"

"github.com/alibaba/higress/plugins/wasm-go/pkg/wrapper"
"github.com/tidwall/gjson"
Expand Down Expand Up @@ -62,7 +63,12 @@ func (c *ProviderConfig) FromJson(json gjson.Result) {
c.serviceName = json.Get("serviceName").String()
c.servicePort = int(json.Get("servicePort").Int())
if !json.Get("servicePort").Exists() {
c.servicePort = 6379
if strings.HasSuffix(c.serviceName, ".static") {
// use default logic port which is 80 for static service
c.servicePort = 80
} else {
c.servicePort = 6379
}
}
c.serviceHost = json.Get("serviceHost").String()
c.username = json.Get("username").String()
Expand Down

0 comments on commit 536ee37

Please sign in to comment.