|
|
@@ -29,13 +29,13 @@ public class AdqAccountReportServiceImpl implements IAdqAccountReportService {
|
|
|
private AdqErrorLogMapper adqErrorLogMapper;
|
|
|
@Autowired
|
|
|
private AdqAccountReportMapper accountReportMapper;
|
|
|
- private static final int MAX_BATCH_SIZE = 5000;
|
|
|
+ /*private static final int MAX_BATCH_SIZE = 5000;
|
|
|
private static final long MAX_WAIT_TIME_MS = 2 * 60 * 1000;
|
|
|
|
|
|
private final List<AdqAdvertiserReportHour> advertiserReportHourBuffer = Collections.synchronizedList(new ArrayList<>());
|
|
|
private final List<AdqAdvertiserReportDaily> advertiserReportDailyBuffer = Collections.synchronizedList(new ArrayList<>());
|
|
|
private long advertiserReportHourLastFlushTime = System.currentTimeMillis();
|
|
|
- private long advertiserReportDailyLastFlushTime = System.currentTimeMillis();
|
|
|
+ private long advertiserReportDailyLastFlushTime = System.currentTimeMillis();*/
|
|
|
|
|
|
@Override
|
|
|
public void getAdqAccountHour(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Integer isLog) {
|
|
|
@@ -97,11 +97,8 @@ public class AdqAccountReportServiceImpl implements IAdqAccountReportService {
|
|
|
}
|
|
|
if (!Check.isNull(hourList)) {
|
|
|
accountReportMapper.addAccountHourList(hourList);
|
|
|
- try {
|
|
|
- advertiserReportHourBuffer.addAll(hourList);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("addAccountHourListSD", e.getMessage());
|
|
|
- }
|
|
|
+ accountReportMapper.addAccountHourListSD(hourList);
|
|
|
+ //advertiserReportHourBuffer.addAll(hourList);
|
|
|
}
|
|
|
if (hourList.size() >= 1000) {
|
|
|
getAdqAccountHour(advertiserId, accessToken, startDate, endDate, page + 1, isLog);
|
|
|
@@ -172,11 +169,8 @@ public class AdqAccountReportServiceImpl implements IAdqAccountReportService {
|
|
|
}
|
|
|
if (!Check.isNull(dailyList)) {
|
|
|
accountReportMapper.addAccountDailyList(dailyList);
|
|
|
- try {
|
|
|
- advertiserReportDailyBuffer.addAll(dailyList);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("addAccountDailyListSD", e);
|
|
|
- }
|
|
|
+ accountReportMapper.addAccountDailyListSD(dailyList);
|
|
|
+ //advertiserReportDailyBuffer.addAll(dailyList);
|
|
|
}
|
|
|
if (dailyList.size() >= 1000) {
|
|
|
getAdqAccountHour(advertiserId, accessToken, startDate, endDate, page + 1, isLog);
|
|
|
@@ -189,7 +183,7 @@ public class AdqAccountReportServiceImpl implements IAdqAccountReportService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Scheduled(fixedRate = 15000) // 每30秒检查一次
|
|
|
+ /*@Scheduled(fixedRate = 15000) // 每30秒检查一次
|
|
|
public void flushIfNeeded() {
|
|
|
log.info("开始执行账户报表定时批处理任务....");
|
|
|
synchronized (advertiserReportHourBuffer) {
|
|
|
@@ -261,6 +255,6 @@ public class AdqAccountReportServiceImpl implements IAdqAccountReportService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}
|