|
@@ -52,6 +52,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.dao.DuplicateKeyException;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
@@ -125,7 +126,7 @@ public class EtlServiceImpl implements EtlService {
|
|
|
long id = 0l;
|
|
|
try {
|
|
|
// 保存数据库
|
|
|
- // TODO: alter table crawler_video drop key unq_video_id;
|
|
|
+ // alter table crawler_video drop key unq_video_id;
|
|
|
CrawlerVideo crawlerVideo = new CrawlerVideo();
|
|
|
BeanUtils.copyProperties(param, crawlerVideo);
|
|
|
String insertSql =
|
|
@@ -239,6 +240,12 @@ public class EtlServiceImpl implements EtlService {
|
|
|
log.error("save data to feishu sheet error. platform {}, strategy {}", platform, strategy, e);
|
|
|
}
|
|
|
});
|
|
|
+ } catch (DuplicateKeyException e) {
|
|
|
+ slsService.log("message", "out video id " + param.getOutVideoId() + " has exist", "crawler", platform,
|
|
|
+ "mode", strategy);
|
|
|
+ log.info("out video id {} of platform {} strategy {} has exist!", param.getOutVideoId(),
|
|
|
+ param.getPlatform(), param.getStrategy());
|
|
|
+ return;
|
|
|
} catch (Exception e) {
|
|
|
log.error("etl server deal {} failed.", param, e);
|
|
|
// 回滚数据
|