提交 239f9724 编写于 作者: Y yong.you

modify the task reload bug

上级 a7f10396
package com.dianping.cat.report.service;
import java.util.Calendar;
import java.util.Date;
import java.util.Set;
......@@ -105,7 +106,6 @@ public class CachedReportTask implements Task {
m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, "bug", bugReport.toString()));
ServiceReport serviceReport = m_reportService.queryServiceReport(domain, start, end);
m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, "service", serviceReport.toString()));
m_end = end.getTime();
}
private void reloadCurrentWeekly() {
......@@ -142,7 +142,6 @@ public class CachedReportTask implements Task {
m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, "bug", bugReport.toString()));
ServiceReport serviceReport = m_reportService.queryServiceReport(domain, start, end);
m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, "service", serviceReport.toString()));
m_end = end.getTime();
}
@Override
......@@ -152,12 +151,15 @@ public class CachedReportTask implements Task {
while (active) {
Date date = TimeUtil.getCurrentDay();
long time = date.getTime();
Calendar cal = Calendar.getInstance();
if (time > m_end) {
//assume dailyreport job has been completed in two hours.
if (time > m_end && cal.get(Calendar.HOUR_OF_DAY) >= 3) {
Transaction t = Cat.newTransaction("System", "ReportReload");
try {
reloadCurrentWeekly();
reloadCurrentMonthly();
m_end = date.getTime();
t.setStatus(Transaction.SUCCESS);
} catch (Exception e) {
Cat.logError(e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册