Commit 67b48e23 by zhiwei

微博超过存储错误修复

parent 4fce8f43
...@@ -47,7 +47,7 @@ public class WeiboTopic { ...@@ -47,7 +47,7 @@ public class WeiboTopic {
this.type = type; this.type = type;
this.time = new Date(); this.time = new Date();
this.day = TimeParse.dateFormartString(new Date(), "yyyy-MM-dd"); this.day = TimeParse.dateFormartString(new Date(), "yyyy-MM-dd");
this.id = topicName + "_" + day; this.id = topicName + "_" + type + "_" + day;
} }
@Override @Override
......
...@@ -38,7 +38,7 @@ public class WeiboTopicRun extends Thread{ ...@@ -38,7 +38,7 @@ public class WeiboTopicRun extends Thread{
private void getTopicList() { private void getTopicList() {
logger.info("微博超话采集开始........"); logger.info("微博超话采集开始........");
List<WeiboTopic> list = WeiboHuatiCrawler.startCrawler(); List<WeiboTopic> list = WeiboHuatiCrawler.startCrawler();
logger.info("{}, 微博此轮采集到的数据量为:{}", new Date(), Integer.valueOf(list != null ? list.size() : 0)); logger.info("{}, 微博超话此轮采集到的数据量为:{}", new Date(), Integer.valueOf(list != null ? list.size() : 0));
List<DBObject> data = new ArrayList<>(); List<DBObject> data = new ArrayList<>();
for(WeiboTopic topic : list){ for(WeiboTopic topic : list){
DBObject doc = new BasicDBObject(); DBObject doc = new BasicDBObject();
......
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