fix: 兼容redis密码验证。
This commit is contained in:
parent
0ac9150e59
commit
8608380d55
@ -221,8 +221,11 @@ func TaskDetails(c *gin.Context) {
|
||||
)
|
||||
|
||||
fileName = c.DefaultQuery("file_name", "")
|
||||
if fileName == "" {
|
||||
app.Error(c, -1, errors.New("参数不正确,请确认file_name参数是否存在"), "")
|
||||
if fileName == "" ||
|
||||
strings.HasPrefix(fileName, ".") ||
|
||||
strings.HasPrefix(fileName, "/") ||
|
||||
strings.HasPrefix(fileName, "\\") {
|
||||
app.Error(c, -1, errors.New("file_name参数不正确,请确认"), "")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,7 @@ settings:
|
||||
maxsize: 10240
|
||||
path: ./logs/ferry.log
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
url: redis://ferry123456@127.0.0.1:6379
|
||||
ssl:
|
||||
key: keystring
|
||||
pem: temp/pem.pem
|
||||
|
@ -53,8 +53,7 @@ settings:
|
||||
maxsize: 10240
|
||||
path: ./logs/ferry.log
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
url: redis://ferry123456@127.0.0.1:6379
|
||||
ssl:
|
||||
key: keystring
|
||||
pem: temp/pem.pem
|
||||
|
@ -2,7 +2,6 @@ package worker
|
||||
|
||||
import (
|
||||
"ferry/pkg/logger"
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
|
||||
@ -23,10 +22,7 @@ func StartServer() {
|
||||
|
||||
func NewTaskCenter() (*machinery.Server, error) {
|
||||
cnf := &taskConfig.Config{
|
||||
Broker: fmt.Sprintf("redis://%v:%v",
|
||||
viper.GetString("settings.redis.host"),
|
||||
viper.GetString("settings.redis.port"),
|
||||
),
|
||||
Broker: viper.GetString("settings.redis.url"),
|
||||
DefaultQueue: "ServerTasksQueue",
|
||||
ResultBackend: "eager",
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user