fix redis over times

back_recharge
wangyuan 2019-05-13 18:31:58 +08:00
parent 36fbfa28e7
commit 3fd33d0068
1 changed files with 3 additions and 0 deletions

View File

@ -801,6 +801,7 @@ public class RedisUtil {
for (int i = 0; i < MAX_TRY_TIMES; i++) { for (int i = 0; i < MAX_TRY_TIMES; i++) {
try { try {
redisTemplate.opsForZSet().incrementScore(rkey,value,changeScore); redisTemplate.opsForZSet().incrementScore(rkey,value,changeScore);
return;
} catch (Exception e) { } catch (Exception e) {
TimeUtils.sleep(FAILED_SLEEP); TimeUtils.sleep(FAILED_SLEEP);
} }
@ -868,6 +869,7 @@ public class RedisUtil {
for (int i = 0; i < MAX_TRY_TIMES; i++) { for (int i = 0; i < MAX_TRY_TIMES; i++) {
try { try {
redisTemplate.opsForHash().put(rkey,mapKey,gson.toJson(value)); redisTemplate.opsForHash().put(rkey,mapKey,gson.toJson(value));
return;
} catch (Exception e) { } catch (Exception e) {
TimeUtils.sleep(FAILED_SLEEP); TimeUtils.sleep(FAILED_SLEEP);
} }
@ -907,6 +909,7 @@ public class RedisUtil {
for (int i = 0; i < MAX_TRY_TIMES; i++) { for (int i = 0; i < MAX_TRY_TIMES; i++) {
try { try {
redisTemplate.opsForHash().delete(rkey,mapKeys); redisTemplate.opsForHash().delete(rkey,mapKeys);
return;
} catch (Exception e) { } catch (Exception e) {
TimeUtils.sleep(FAILED_SLEEP); TimeUtils.sleep(FAILED_SLEEP);
} }