Commit 03fee680 authored by hezhen's avatar hezhen

Merge branch 'dev' of http://113.105.137.151:22280/youjj/cloud-platform into dev

parents 4d0f80a0 1ccd7073
...@@ -86,11 +86,14 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act ...@@ -86,11 +86,14 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act
}}); }});
log.info("活动邀请注册:activityPopularize = {}", activityPopularize.toString()); log.info("活动邀请注册:activityPopularize = {}", activityPopularize.toString());
if (activityPopularize != null) { if (activityPopularize != null) {
String lockKey = String.format("%s%d:%s:%d",registerQueueDTO.getInParamDTO().getActivityCode(), registerQueueDTO.getAppUserId(), registerQueueDTO.getInParamDTO().getUsername(), activityPopularize.getId()); String lockKey = String.format("%s%d%d", registerQueueDTO.getInParamDTO().getActivityCode(), appUserDTO.getInviterAccount(), activityPopularize.getId());
RLock rLock = redissonLock.getRLock(lockKey); RLock rLock = redissonLock.getRLock(lockKey);
try { try {
boolean isSuccess = rLock.tryLock(5, 5, TimeUnit.SECONDS); boolean isSuccess = rLock.tryLock(5, 5, TimeUnit.SECONDS);
if (isSuccess) { if (isSuccess) {
log.info("1, {}", System.currentTimeMillis());
Thread.sleep(1000);
log.info("2, {}", System.currentTimeMillis());
List<ActivityPopularizeItem> activityPopularizeItems = activityPopularizeItemBiz.selectByPopularizeId(activityPopularize.getId()); List<ActivityPopularizeItem> activityPopularizeItems = activityPopularizeItemBiz.selectByPopularizeId(activityPopularize.getId());
ActivityPopularizeItem activityPopularizeItem = activityPopularizeItems.get(activityPopularizeItems.size() - 1); ActivityPopularizeItem activityPopularizeItem = activityPopularizeItems.get(activityPopularizeItems.size() - 1);
Date now = DateUtil.date(); Date now = DateUtil.date();
...@@ -196,6 +199,8 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act ...@@ -196,6 +199,8 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
log.error("tryLock fail, key = [{}]", lockKey); log.error("tryLock fail, key = [{}]", lockKey);
} finally {
log.info("执行结束, {}", System.currentTimeMillis());
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment