Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisTemplateWxRedisOps 不过期设置问题 #1548

Closed
zacat opened this issue May 7, 2020 · 1 comment
Closed

RedisTemplateWxRedisOps 不过期设置问题 #1548

zacat opened this issue May 7, 2020 · 1 comment

Comments

@zacat
Copy link

zacat commented May 7, 2020

简要描述

ERR invalid expire time in SETEX

模块版本情况

  • WxJava 模块名: weixin-java-open
  • WxJava 版本号: 3.7.8.B

详细描述

在RedisTemplateWxRedisOps的SetValue中,设置0,Key永不过期,Redis报错,错误提示:ERR invalid expire time in SETEX

其中到期时间不能小于等于0, 所以报错。

如需永不过期,目前修改如下可用:
@OverRide
public void setValue(String key, String value, int expire, TimeUnit timeUnit) {
if (expire < 0) {
redisTemplate.opsForValue().set(key, value);
} else {
redisTemplate.opsForValue().set(key, value, expire, timeUnit);
}
}

image

修改setAuthorizerRefreshToken时长为-1
@OverRide
public void setAuthorizerRefreshToken(String appId, String authorizerRefreshToken) {
redisOps.setValue(this.getKey(this.authorizerRefreshTokenKey, appId), authorizerRefreshToken, -1, TimeUnit.SECONDS);
}

image

lkqm added a commit to lkqm/WxJava that referenced this issue May 12, 2020
binarywang pushed a commit that referenced this issue May 12, 2020
@binarywang
Copy link
Owner

3.7.9.B版本已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants