|
@@ -41,23 +41,14 @@ public class TodayPublishStrategy implements FilterStrategy {
|
|
|
List<String> result = Collections.synchronizedList(param.getContents().stream().map(Content::getId).collect(Collectors.toList()));
|
|
List<String> result = Collections.synchronizedList(param.getContents().stream().map(Content::getId).collect(Collectors.toList()));
|
|
|
Long todayStart = DateUtils.getTodayStart();
|
|
Long todayStart = DateUtils.getTodayStart();
|
|
|
List<PublishContent> todayPublishContentList = aigcBaseMapper.getTodayPublishContentList(param.getAccountId(), todayStart);
|
|
List<PublishContent> todayPublishContentList = aigcBaseMapper.getTodayPublishContentList(param.getAccountId(), todayStart);
|
|
|
|
|
+ List<PublishContent> todayPublishFailList = aigcBaseMapper.getTodayPublishFailContentList(param.getAccountId(), todayStart);
|
|
|
if (CollectionUtils.isNotEmpty(todayPublishContentList)) {
|
|
if (CollectionUtils.isNotEmpty(todayPublishContentList)) {
|
|
|
List<String> todayPublishContentIdList = todayPublishContentList.stream().map(PublishContent::getId).collect(Collectors.toList());
|
|
List<String> todayPublishContentIdList = todayPublishContentList.stream().map(PublishContent::getId).collect(Collectors.toList());
|
|
|
- CountDownLatch cdl = new CountDownLatch(todayPublishContentIdList.size());
|
|
|
|
|
- for (String todayPublishContentId : todayPublishContentIdList) {
|
|
|
|
|
- pool.submit(() -> {
|
|
|
|
|
- try {
|
|
|
|
|
- result.remove(todayPublishContentId);
|
|
|
|
|
- } finally {
|
|
|
|
|
- cdl.countDown();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- try {
|
|
|
|
|
- cdl.await();
|
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
|
- log.error("TodayPublishStrategy filter error", e);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ result.removeAll(todayPublishContentIdList);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(todayPublishFailList)) {
|
|
|
|
|
+ List<String> todayPublishFailIdList = todayPublishFailList.stream().map(PublishContent::getId).collect(Collectors.toList());
|
|
|
|
|
+ result.removeAll(todayPublishFailIdList);
|
|
|
}
|
|
}
|
|
|
filterResult.setContentIds(result);
|
|
filterResult.setContentIds(result);
|
|
|
log.info("TodayPublishStrategy filter cost time:{}", System.currentTimeMillis() - start);
|
|
log.info("TodayPublishStrategy filter cost time:{}", System.currentTimeMillis() - start);
|