Authored by mingdan.ge

测试

@@ -26,7 +26,7 @@ public class CpsOrdersSumMessageTask { @@ -26,7 +26,7 @@ public class CpsOrdersSumMessageTask {
26 IUnionShareService unionShareService; 26 IUnionShareService unionShareService;
27 27
28 @Resource 28 @Resource
29 - GlobalRedisValueCache redisValueCache; 29 + GlobalRedisValueCache globalRedisValueCache;
30 30
31 private static String TASK_KEY = "yh:union:share:CpsOrdersSumMessageTask:"; 31 private static String TASK_KEY = "yh:union:share:CpsOrdersSumMessageTask:";
32 32
@@ -58,9 +58,10 @@ public class CpsOrdersSumMessageTask { @@ -58,9 +58,10 @@ public class CpsOrdersSumMessageTask {
58 // } 58 // }
59 59
60 String key = TASK_KEY + DateUtil.getToday("yyyyMMdd"); 60 String key = TASK_KEY + DateUtil.getToday("yyyyMMdd");
61 - boolean lock = redisValueCache.getLock(key,2, TimeUnit.DAYS); 61 + boolean lock = globalRedisValueCache.getLock(key,2, TimeUnit.DAYS);
62 if (!lock) { 62 if (!lock) {
63 logger.info("The competition failure,other get task."); 63 logger.info("The competition failure,other get task.");
  64 + return;
64 } 65 }
65 logger.info("get this task,ip is {}",LocalhostIpFetcher.fetchLocalIP()); 66 logger.info("get this task,ip is {}",LocalhostIpFetcher.fetchLocalIP());
66 67
@@ -25,7 +25,7 @@ public class CpsSettlementMessageTask { @@ -25,7 +25,7 @@ public class CpsSettlementMessageTask {
25 @Autowired 25 @Autowired
26 IUnionShareService unionShareService; 26 IUnionShareService unionShareService;
27 @Resource 27 @Resource
28 - GlobalRedisValueCache redisValueCache; 28 + GlobalRedisValueCache globalRedisValueCache;
29 29
30 private static String SETTLEMENT_TASK_KEY = "yh:union:share:CpsSettlementMessageTask:"; 30 private static String SETTLEMENT_TASK_KEY = "yh:union:share:CpsSettlementMessageTask:";
31 31
@@ -58,9 +58,10 @@ public class CpsSettlementMessageTask { @@ -58,9 +58,10 @@ public class CpsSettlementMessageTask {
58 // } 58 // }
59 59
60 String key = SETTLEMENT_TASK_KEY + DateUtil.getToday("yyyyMMdd"); 60 String key = SETTLEMENT_TASK_KEY + DateUtil.getToday("yyyyMMdd");
61 - boolean lock = redisValueCache.getLock(key,2, TimeUnit.DAYS); 61 + boolean lock = globalRedisValueCache.getLock(key,2, TimeUnit.DAYS);
62 if (!lock) { 62 if (!lock) {
63 logger.info("The competition failure,other get task."); 63 logger.info("The competition failure,other get task.");
  64 + return;
64 } 65 }
65 logger.info("get this task,ip is {}",LocalhostIpFetcher.fetchLocalIP()); 66 logger.info("get this task,ip is {}",LocalhostIpFetcher.fetchLocalIP());
66 //今天更新的数据 67 //今天更新的数据
@@ -3,6 +3,10 @@ redis: @@ -3,6 +3,10 @@ redis:
3 servers: 3 servers:
4 - 192.168.102.45:6379 4 - 192.168.102.45:6379
5 auth: redis9646 5 auth: redis9646
  6 + yohoGlobalRedis :
  7 + servers:
  8 + - 192.168.102.45:6379
  9 + auth: redis9646
6 yohoSyncRedis : 10 yohoSyncRedis :
7 servers: 11 servers:
8 - 192.168.102.45:6379 12 - 192.168.102.45:6379