浏览代码

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

Signed-off-by: when <w_zhi_yuan@163.com>

when 2 年之前
父节点
当前提交
87fe21fcfb

+ 1 - 0
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/code/RedisAuthorizationCodeServices.java

@@ -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;
 	}