Commit f183be6b by 马黎滨

脉脉热榜采集修改

parent 76e4f01b
...@@ -150,7 +150,7 @@ public class HotSearchCacheDAO { ...@@ -150,7 +150,7 @@ public class HotSearchCacheDAO {
collection.replaceOne(query, nowDoc); collection.replaceOne(query, nowDoc);
} else { } else {
nowDoc = new Document(); nowDoc = new Document();
int durationNow = getDuration(type, 0); int durationNow = 1;
nowDoc.put("_id", id); nowDoc.put("_id", id);
nowDoc.put("url", url); nowDoc.put("url", url);
nowDoc.put("name", name); nowDoc.put("name", name);
......
...@@ -369,6 +369,12 @@ public class GatherTimer { ...@@ -369,6 +369,12 @@ public class GatherTimer {
public void crawlerMaiMaiHotSearch(){ public void crawlerMaiMaiHotSearch(){
Date date = DateUtils.getMillSecondTime(new Date()); Date date = DateUtils.getMillSecondTime(new Date());
List<HotSearchList> list = MaiMaiHotSearchCrawler.getMaiMaiHotData(date); List<HotSearchList> list = MaiMaiHotSearchCrawler.getMaiMaiHotData(date);
int i=0;
while (list.size()==0 && i<10){
ZhiWeiTools.sleep(5000L);
list = MaiMaiHotSearchCrawler.getMaiMaiHotData(date);
i++;
}
TipsUtils.addHotList(HotSearchType.脉脉热榜.name(),list); TipsUtils.addHotList(HotSearchType.脉脉热榜.name(),list);
} }
......
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