添加系统运行配置文件写入redis,用于排查
This commit is contained in:
parent
6d13cb36fb
commit
3b10099310
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -140,8 +141,9 @@ func ReadConfig(path string) error {
|
||||||
//将当前配置文件的信息写入redis,用于程序运行时排查
|
//将当前配置文件的信息写入redis,用于程序运行时排查
|
||||||
configJson, cErr := json.Marshal(Config)
|
configJson, cErr := json.Marshal(Config)
|
||||||
if cErr != nil {
|
if cErr != nil {
|
||||||
fmt.Println("ReadConfig Error encoding config,err :", cErr)
|
log.Println("ReadConfig Error encoding config,err :", cErr)
|
||||||
} else {
|
} else {
|
||||||
|
log.Println("ReadConfig configJson:", string(configJson))
|
||||||
worker.SetRedis("system_config_info", string(configJson))
|
worker.SetRedis("system_config_info", string(configJson))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue