修正redis连接不释放

程序运行时间长会出现redis连接超过最大值错误:Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR max number of clients reached

Signed-off-by: when <w_zhi_yuan@163.com>
This commit is contained in:
when 2022-08-19 02:38:17 +00:00 committed by Gitee
parent 4f3e80ac83
commit 87fe21fcfb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -58,6 +58,7 @@ public class RedisAuthorizationCodeServices extends RandomValueAuthorizationCode
RedisConnection conn=connectionFactory.getConnection();
OAuth2Authentication auth = conn.getObject(PREFIX+code);
conn.delete(PREFIX+code);
conn.close();
return auth;
}