|
@@ -323,7 +323,7 @@ public class RecommendService {
|
|
|
data.setInFlowPool(true);
|
|
|
} else {
|
|
|
String isIn_flow_pool_key =
|
|
|
- String.format("flow:pool:video:ids:%s:3", param.getAppType());
|
|
|
+ String.format("flow:pool:video:ids:%s", param.getAppType());
|
|
|
String flow_pool_key =
|
|
|
String.format("flow:pool:video:%s:%s", param.getAppType(), videoId);
|
|
|
if (redisTemplate.opsForSet().isMember(isIn_flow_pool_key, String.valueOf(videoId))) {
|
|
@@ -338,7 +338,7 @@ public class RecommendService {
|
|
|
}
|
|
|
|
|
|
private void updateCache(RecommendRequest request, RecommendParam param, List<Video> videos) {
|
|
|
- if (StringUtils.isNotBlank(request.getMid())
|
|
|
+ if (StringUtils.isBlank(request.getMid())
|
|
|
|| CollectionUtils.isEmpty(videos)) {
|
|
|
return;
|
|
|
}
|
|
@@ -362,6 +362,10 @@ public class RecommendService {
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(flowPoolVideos)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
switch (param.getFlowPoolAbtestGroup()) {
|
|
|
case FlowPoolConstants.EXPERIMENTAL_FLOW_SET_LEVEL:
|
|
|
flowPoolService.updateDistributeCountWithLevel(flowPoolVideos);
|
|
@@ -383,6 +387,7 @@ public class RecommendService {
|
|
|
redisTemplate.opsForValue().set(String.format(RegionHRecallStrategy.LAST_VIDEO_KEY_FORMAT,
|
|
|
request.getAppType(), request.getMid()), String.valueOf(videos.get(i).getVideoId()),
|
|
|
24, TimeUnit.HOURS);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -392,6 +397,7 @@ public class RecommendService {
|
|
|
redisTemplate.opsForValue().set(String.format(Region24HRecallStrategy.LAST_VIDEO_KEY_FORMAT,
|
|
|
request.getAppType(), request.getMid()), String.valueOf(videos.get(i).getVideoId()),
|
|
|
24, TimeUnit.HOURS);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -401,6 +407,7 @@ public class RecommendService {
|
|
|
redisTemplate.opsForValue().set(String.format(RegionRelative24HRecallStrategy.LAST_VIDEO_KEY_FORMAT,
|
|
|
request.getAppType(), request.getMid()), String.valueOf(videos.get(i).getVideoId()),
|
|
|
24, TimeUnit.HOURS);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -410,6 +417,7 @@ public class RecommendService {
|
|
|
redisTemplate.opsForValue().set(String.format(RegionRelative24HDupRecallStrategy.LAST_VIDEO_KEY_FORMAT,
|
|
|
request.getAppType(), request.getMid()), String.valueOf(videos.get(i).getVideoId()),
|
|
|
24, TimeUnit.HOURS);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|