Commit fa3b5b7e by zhiwei

处理微博推荐位的微博热搜,因为无排名所以不纳入总的排名缓存数据表

parent de934c9d
...@@ -68,6 +68,9 @@ public class HotSearchCacheDAO { ...@@ -68,6 +68,9 @@ public class HotSearchCacheDAO {
String url = document.getString("url")!=null?document.getString("url"):null; String url = document.getString("url")!=null?document.getString("url"):null;
String id = name + "_" + type; String id = name + "_" + type;
Document query = new Document("_id", id); Document query = new Document("_id", id);
//判断是否为微博推荐位,推荐位微博无排名,所以不纳入总的缓存表
if(Objects.nonNull(lastRank) && lastRank >0 ){
Document nowDoc = (Document) collection.find(query).first(); Document nowDoc = (Document) collection.find(query).first();
if (Objects.nonNull(nowDoc)) { if (Objects.nonNull(nowDoc)) {
Integer highestRank = nowDoc.getInteger("highestRank"); Integer highestRank = nowDoc.getInteger("highestRank");
...@@ -121,6 +124,10 @@ public class HotSearchCacheDAO { ...@@ -121,6 +124,10 @@ public class HotSearchCacheDAO {
collection.insertOne(nowDoc); collection.insertOne(nowDoc);
} }
}
}catch (Exception e){ }catch (Exception e){
log.info("数据存储时出错:{}", e); log.info("数据存储时出错:{}", e);
} }
......
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