Commit df6c088c by wutong

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

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