wangyunpeng 7 months ago
parent
commit
12f29edbca

+ 4 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/DataFlushService.java

@@ -125,8 +125,10 @@ public class DataFlushService {
                     List<LongArticlesCrawlerVideos> itemList = existsMap.get(o.getContentId());
                     return CollectionUtil.isEmpty(itemList) || itemList.size() < 3;
                 }).collect(Collectors.toList());
-                longArticleBaseMapper.batchInsertLongArticlesCrawlerVideos(partition);
-                flushNum += partition.size();
+                if (CollectionUtil.isNotEmpty(partition)) {
+                    longArticleBaseMapper.batchInsertLongArticlesCrawlerVideos(partition);
+                    flushNum += partition.size();
+                }
             }
         }
         log.info("flushLongArticlesCrawlerVideos flushNum:{}", flushNum);

+ 1 - 1
long-article-recommend-service/src/main/resources/mapper/crawler/CrawlerBaseMapper.xml

@@ -29,7 +29,7 @@
         select * from article_match_videos order by video_id
     </select>
     <select id="countLongArticlesVideos" resultType="java.lang.Integer">
-        select count(1) from long_articles_video where DATE(update_time) &gt;= '2024-09-20' and success = 1 and content_status = 2
+        select count(1) from long_articles_video where success = 1 and content_status = 2
     </select>
     <select id="pageLongArticlesVideos"
             resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesVideo">

+ 1 - 1
long-article-recommend-service/src/main/resources/mapper/longArticle/LongArticleBaseMapper.xml

@@ -125,7 +125,7 @@
     </select>
     <select id="getLongArticlesCrawlerVideos"
             resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesCrawlerVideos">
-        select * from long_article_crawler_videos where content_id in
+        select * from long_articles_crawler_videos where content_id in
         <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
             #{item}
         </foreach>