From 6d13cb36fb837fd445733502f9eb43722dec9c74 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sat, 3 May 2025 11:48:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=86=99=E5=85=A5?= =?UTF-8?q?redis,=E7=94=A8=E4=BA=8E=E6=8E=92=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/conf.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proto/conf.go b/proto/conf.go index 5013db3..52a2197 100644 --- a/proto/conf.go +++ b/proto/conf.go @@ -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 }