| | |
| | | private JSONObject curObj; |
| | | private static final int CONNECTION_TIMEOUT = 60000;// 连接超时时间 |
| | | private static final int SO_TIMEOUT = 60000;// 读取超时时间 |
| | | private boolean localFlag; |
| | | private static Map<JSONObject, JedisPool> map = Maps.newHashMap(); |
| | | private static Map<JSONObject, JedisSentinelPool> sentinelPoolMap = Maps.newHashMap(); |
| | | private static Map<JSONObject, RedisSentinelUtil> redisSentinelUtil = Maps.newHashMap(); |
| | |
| | | } catch (Exception e) { |
| | | throw new BaseException(ErrorCode.GET_REDIS_CONNECTION_FAIL); |
| | | } |
| | | } |
| | | |
| | | public RedisService() { |
| | | this.localFlag = true; |
| | | } |
| | | |
| | | public void close() { |
| | |
| | | * @return Jedis |
| | | */ |
| | | public Jedis getJedis() { |
| | | if (localFlag) { |
| | | return RedisUtil.getJedis(); |
| | | } |
| | | String dbType = curObj.getString("db_type"); |
| | | Jedis jedis; |
| | | if ("6".equals(dbType)) { |