| | |
| | | if (null == this.pool) { |
| | | JedisPoolConfig config = new JedisPoolConfig(); |
| | | config.setTestOnBorrow(false); |
| | | config.setMaxWaitMillis(5000L); |
| | | int maxTotal = redisProperties.getMax() > 0 ? redisProperties.getMax() : 32; |
| | | config.setMaxTotal(maxTotal); |
| | | this.index = redisProperties.getIndex(); |
| | | // 空白密码传 null,不向未开认证的 Redis 发 AUTH |
| | | String pwd = StringUtils.trimToNull(redisProperties.getPassword()); |
| | |
| | | return jedis.get(flag + LINK + key); |
| | | } catch (Exception e) { |
| | | log.error(this.getClass().getSimpleName(), e); |
| | | } finally { |
| | | jedis.close(); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return jedis.del(keys); |
| | | } catch (Exception e) { |
| | | log.error(this.getClass().getSimpleName(), e); |
| | | } finally { |
| | | jedis.close(); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | } catch (Exception e) { |
| | | log.error(this.getClass().getSimpleName(), e); |
| | | return true; |
| | | } finally { |
| | | jedis.close(); |
| | | } |
| | | } |
| | | |