Update..
parent
a5dbb89e0d
commit
3e7d764356
|
@ -40,10 +40,8 @@ class RedisCacheUtil implements DataCache {
|
||||||
String retVal = null;
|
String retVal = null;
|
||||||
do {
|
do {
|
||||||
tries++;
|
tries++;
|
||||||
try {
|
try (Jedis jedis = pool.getResource()) {
|
||||||
Jedis jedis = pool.getResource();
|
|
||||||
retVal = jedis.set(key.getBytes(), value);
|
retVal = jedis.set(key.getBytes(), value);
|
||||||
jedis.close();
|
|
||||||
sucess = true;
|
sucess = true;
|
||||||
} catch (JedisConnectionException ex) {
|
} catch (JedisConnectionException ex) {
|
||||||
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
||||||
|
@ -65,10 +63,8 @@ class RedisCacheUtil implements DataCache {
|
||||||
Long retVal = null;
|
Long retVal = null;
|
||||||
do {
|
do {
|
||||||
tries++;
|
tries++;
|
||||||
try {
|
try (Jedis jedis = pool.getResource()) {
|
||||||
Jedis jedis = pool.getResource();
|
|
||||||
retVal = jedis.setnx(key.getBytes(), value);
|
retVal = jedis.setnx(key.getBytes(), value);
|
||||||
jedis.close();
|
|
||||||
sucess = true;
|
sucess = true;
|
||||||
} catch (JedisConnectionException ex) {
|
} catch (JedisConnectionException ex) {
|
||||||
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
||||||
|
@ -90,10 +86,8 @@ class RedisCacheUtil implements DataCache {
|
||||||
Long retVal = null;
|
Long retVal = null;
|
||||||
do {
|
do {
|
||||||
tries++;
|
tries++;
|
||||||
try {
|
try (Jedis jedis = pool.getResource()) {
|
||||||
Jedis jedis = pool.getResource();
|
|
||||||
retVal = jedis.expire(key, seconds);
|
retVal = jedis.expire(key, seconds);
|
||||||
jedis.close();
|
|
||||||
sucess = true;
|
sucess = true;
|
||||||
} catch (JedisConnectionException ex) {
|
} catch (JedisConnectionException ex) {
|
||||||
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
||||||
|
@ -115,10 +109,8 @@ class RedisCacheUtil implements DataCache {
|
||||||
byte[] retVal = null;
|
byte[] retVal = null;
|
||||||
do {
|
do {
|
||||||
tries++;
|
tries++;
|
||||||
try {
|
try (Jedis jedis = pool.getResource()) {
|
||||||
Jedis jedis = pool.getResource();
|
|
||||||
retVal = jedis.get(key.getBytes());
|
retVal = jedis.get(key.getBytes());
|
||||||
jedis.close();
|
|
||||||
sucess = true;
|
sucess = true;
|
||||||
} catch (JedisConnectionException ex) {
|
} catch (JedisConnectionException ex) {
|
||||||
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
||||||
|
@ -140,10 +132,8 @@ class RedisCacheUtil implements DataCache {
|
||||||
Long retVal = null;
|
Long retVal = null;
|
||||||
do {
|
do {
|
||||||
tries++;
|
tries++;
|
||||||
try {
|
try (Jedis jedis = pool.getResource()) {
|
||||||
Jedis jedis = pool.getResource();
|
|
||||||
retVal = jedis.del(key);
|
retVal = jedis.del(key);
|
||||||
jedis.close();
|
|
||||||
sucess = true;
|
sucess = true;
|
||||||
} catch (JedisConnectionException ex) {
|
} catch (JedisConnectionException ex) {
|
||||||
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
|
||||||
|
|
Loading…
Reference in New Issue