Commit fbbc9206 authored by luxq's avatar luxq

update code

parent f2131b98
......@@ -47,7 +47,7 @@ func (c *CacheData) GetWhWithAddr(addr string) (*model.Whitelist, error) {
}
func (c *CacheData) SetWhiteListToRedis(wh *model.Whitelist) error {
whKey := "wh-a-" + strings.ToLower(wh.Character)
whKey := "wh-a-" + strings.ToLower(wh.ProfitAddress)
if data, err := json.Marshal(wh); err == nil {
if err = c.rdb.Set(c.ctx, whKey, string(data), 0).Err(); err == nil {
return nil
......@@ -59,7 +59,7 @@ func (c *CacheData) SetWhiteListToRedis(wh *model.Whitelist) error {
}
func (c *CacheData) DeleteWhiteList(wh *model.Whitelist) error {
whKey := "wh-a-" + strings.ToLower(wh.Character)
whKey := "wh-a-" + strings.ToLower(wh.ProfitAddress)
if err := c.rdb.Del(c.ctx, whKey).Err(); err == nil || err == redis.ErrNil {
return nil
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment