Commit ef9cfa01e30388b9042f20615fd50ce299e5296f
1 parent
31609a68
2023年9月15日16:36:13 解决并发上报直播数据问题导致旧数据覆盖新数据
Showing
1 changed file
with
1 additions
and
0 deletions
src/main/java/cn/fw/freya/service/CrawlBizService.java
... | ... | @@ -275,6 +275,7 @@ public class CrawlBizService { |
275 | 275 | String accountNo = account.getAccountNo(); |
276 | 276 | AccountTypeEnum typeEnum = AccountTypeEnum.getEnumByValue(type); |
277 | 277 | CrawlStrategy crawlStrategy = crawlStrategyMap.get(typeEnum); |
278 | + LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(10));// 线程挂起10秒, 防止并发上报, 旧数据覆盖新数据 | |
278 | 279 | List<LivePool> yesterdayLiveMsg = crawlStrategy.getYesterdayLiveMsg(accountNo);// 获取昨日直播信息 |
279 | 280 | boolean reportLive = this.doReportLive(account, yesterdayLiveMsg); |
280 | 281 | if (!reportLive) { | ... | ... |