diff --git a/rule/egg_energy/give_activty_coin.go b/rule/egg_energy/give_activty_coin.go index 7fe2227..2fa9c3f 100644 --- a/rule/egg_energy/give_activty_coin.go +++ b/rule/egg_energy/give_activty_coin.go @@ -69,7 +69,7 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin redisConn := cache.GetPool().Get() sysCfgDb := implement.NewSysCfgDb(engine, redisConn) defer func(sysCfgDb dao.SysCfgDao) { - err := sysCfgDb.Close() + err = sysCfgDb.Close() if err != nil { fmt.Println("redis close err:" + err.Error()) // 记录错误信息 } diff --git a/svc/svc_file_img_format.go b/svc/svc_file_img_format.go index 9fb98cb..1534280 100644 --- a/svc/svc_file_img_format.go +++ b/svc/svc_file_img_format.go @@ -1,8 +1,10 @@ package svc import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum" + zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils/logx" "fmt" "github.com/gomodule/redigo/redis" "strings" @@ -12,6 +14,12 @@ import ( // ImageBucket is 获取域名 func ImageBucket(engine *xorm.Engine, conn redis.Conn) (string, string) { sysCfgDb := implement.NewSysCfgDb(engine, conn) + defer func(sysCfgDb dao.SysCfgDao) { + err := sysCfgDb.Close() + if err != nil { + zhios_order_relate_logx.Error("redis close err:" + err.Error()) // 记录错误信息 + } + }(sysCfgDb) res := sysCfgDb.SysCfgFindWithDb(enum.AliyunOssBucketScheme, enum.AliyunOssDomain) return res[enum.AliyunOssBucketScheme], res[enum.AliyunOssDomain] }