添加系统运行配置文件写入redis,用于排查
This commit is contained in:
parent
f93288cf0e
commit
6d13cb36fb
|
|
@ -1,6 +1,7 @@
|
|||
package proto
|
||||
|
||||
import (
|
||||
"StuAcaWorksAI/worker"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"gorm.io/gorm"
|
||||
|
|
@ -136,6 +137,13 @@ func ReadConfig(path string) error {
|
|||
}
|
||||
}
|
||||
SigningKey = []byte(Config.TOKEN_SECRET)
|
||||
//将当前配置文件的信息写入redis,用于程序运行时排查
|
||||
configJson, cErr := json.Marshal(Config)
|
||||
if cErr != nil {
|
||||
fmt.Println("ReadConfig Error encoding config,err :", cErr)
|
||||
} else {
|
||||
worker.SetRedis("system_config_info", string(configJson))
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue