Commit 76381835 by chenweitao

Merge branch 'working' into 'master'

增加脉脉采集名称长度日志

See merge request !139
parents 1c4f37c9 fcee33bb
......@@ -48,7 +48,6 @@ public class MaiMaiHotSearchCrawler {
if (name.length()>750){
name = name.substring(0,750);
}
// log.info(name);
String maimaiUrl = jsonObject.getString("share_url");
String icon = null;
if (jsonObject.containsKey("hot_type_card")) {
......@@ -57,6 +56,9 @@ public class MaiMaiHotSearchCrawler {
String hotValue = jsonArray.getJSONObject(i).getJSONObject("common").getString("hot_info");
Long count = hotValue.length() > 0 ? TipsUtils.getHotCount(hotValue) : 0;
HotSearchList hotSearchList = new HotSearchList(maimaiUrl, name, count, null, rank, HotSearchType.脉脉热榜.name(), icon, date);
if (hotSearchList.getName().length()>800){
log.info("脉脉数据名称过长,长度为:{},内容:{}",hotSearchList.getName().length(),hotSearchList.getName());
}
list.add(hotSearchList);
}
}
......
package com.zhiwei.searchhotcrawler.dao;
import com.mongodb.MongoWriteException;
import com.mongodb.client.MongoCollection;
import com.zhiwei.searchhotcrawler.bean.HotSearchList;
import com.zhiwei.searchhotcrawler.config.DBConfig;
......@@ -283,8 +284,10 @@ public class HotSearchCacheDAO {
collection.insertOne(nowDoc);
}
}
} catch (Exception e) {
log.error("数据存储时出错:", e);
}catch (MongoWriteException e1){
log.error("数据写入时出错,数据为【{}】:", document,e1);
}catch (Exception e) {
log.error("数据存储时出错,数据为【{}】:", document,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