ip缓存配置参数不等于0修复
This commit is contained in:
@@ -114,7 +114,7 @@ func (h *HuaChenIpClient) GetIpInfoFormCache(ctx context.Context, ip string, opt
|
||||
return nil, errors.Wrapf(err, "无法将IP信息转换为JSON,ip:%s", ip)
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
if len(opt) != 0 {
|
||||
err = h.cache.Set(ctx, h.ipKey(ip), string(infoJson), opt[0])
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "缓存ip:%s信息失败,", ip)
|
||||
|
Reference in New Issue
Block a user