Commit df6c088c by wutong

分片为0的账号单独跑一次

parent e70c9138
......@@ -181,7 +181,8 @@ public class AmazonAdProductJob extends PointJob {
gzin = new GZIPInputStream(response.body().byteStream());
isr = new InputStreamReader(gzin, "utf8");
bufferedReader = new BufferedReader(isr);
int i1 = (int) response.body().contentLength() * 64;
int i1 = (int) response.body().contentLength() * 48;
log.warn("计算的长度 " +i1);
StringBuffer sb = new StringBuffer(i1);
String str = null;
while ((str = bufferedReader.readLine()) != null) {
......@@ -331,7 +332,7 @@ public class AmazonAdProductJob extends PointJob {
int i = 0;
try {
DcBaseCompanyAccountMapper accountMapper = SessionUtil.getSession().getMapper(DcBaseCompanyAccountMapper.class);
i = (int)accountMapper.countByExample(DcBaseCompanyAccountExample.newAndCreateCriteria().andPlatformIdEqualTo(platformId).example());
i = (int)accountMapper.countByExample(DcBaseCompanyAccountExample.newAndCreateCriteria().andPlatformIdEqualTo(platformId).example().limit(1, 63));
} catch (Exception e) {
e.printStackTrace();
} finally {
......
......@@ -44,15 +44,11 @@ public class AmazonAdProductTest {
public void test2() {
AmazonAdProductJob amazonAdProductJob = new AmazonAdProductJob();
JobAccountLogMapper mapper = SessionUtil.getSession().getMapper(JobAccountLogMapper.class);
JobAccountLog dcBaseCompanyAccount = mapper.selectOneByExample(JobAccountLogExample.newAndCreateCriteria().andAccountIdEqualTo(785).example());
dcBaseCompanyAccount.setStartTime(LocalDateTime.of(2019, 7, 24, 10, 0));
dcBaseCompanyAccount.setEndTime(LocalDateTime.of(2019, 7, 24, 11, 0));
JobAccountLog dcBaseCompanyAccount = mapper.selectOneByExample(JobAccountLogExample.newAndCreateCriteria().andAccountIdEqualTo(572).example());
dcBaseCompanyAccount.setStartTime(LocalDateTime.of(2019, 5, 30, 10, 0));
dcBaseCompanyAccount.setEndTime(LocalDateTime.of(2019, 5, 30, 11, 0));
while (dcBaseCompanyAccount.getStartTime().isBefore(LocalDateTime.now().plusDays(1L))) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
amazonAdProductJob.callAmazonAdApi(dcBaseCompanyAccount);
log.warn("TEST----" +dcBaseCompanyAccount.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) );
}
......
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