Fix bugs with recomputing history.

This commit is contained in:
Marina Samuel 2014-09-17 14:57:17 -04:00
Родитель 73c2925070
Коммит b3f0198e76
5 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -406,6 +406,9 @@ InterestDashboard.prototype = {
}
$("#visual-header-overlay").addClass("fade-out");
$("#main-overlay").addClass("fade-out");
$scope.daysLeft = null;
$scope.daysLeftStart = null;
$scope.percentProcessed = null;
} else {
setTimeout(() => {
if (!$scope.percentProcessed) {
@ -419,6 +422,9 @@ InterestDashboard.prototype = {
}
$("#visual-header-overlay").addClass("fade-out");
$("#main-overlay").addClass("fade-out");
$scope.daysLeft = null;
$scope.daysLeftStart = null;
$scope.percentProcessed = null;
}
}, 2000);
}

Просмотреть файл

@ -334,6 +334,8 @@ let AboutYou = {
});
worker.port.on("history_process", () => {
storage.chartData = {};
storage.dayBufferInterests = {};
storage.domains = {};
StudyApp.controller.resubmitHistory({report: AboutYou.processingDaysLeft, flush: true}).then(AboutYou.historySubmitComplete);
});
}

Просмотреть файл

@ -99,8 +99,6 @@ Controller.prototype = {
});
stream.addNode(streamObjects.chartDataProcessorBolt);
stream.addNode(streamObjects.interestDashboardDataProcessorBolt);
stream.addNode(streamObjects.hostStripBolt);
stream.addNode(streamObjects.interestStorageBolt);
return streamObjects;
},

Просмотреть файл

@ -24,8 +24,9 @@ let ChartDataProcessorBolt = {
this.debugReport.push("~*~* chartDataProcessorBolt ingest() start *~*~");
DataProcessorHelper.initChartInStorage("genericChartData", this.storage);
let storageData = this.storage.chartData.genericChartData;
let days = Object.keys(message);
this.debugReport.push("Processing chart data for " + days.length + " days: [" + days.toString().replace(/,/g, '; ') + "]");
for (let day in message) {
this.debugReport.push("Processing chart data for day [" + day + "] start");
for (let type in message[day]) {
for (let namespace in message[day][type]) {
if (!storageData[type]) {
@ -44,7 +45,6 @@ let ChartDataProcessorBolt = {
}
}
}
this.debugReport.push("Processing chart data for day [" + day + "] complete");
}
for (let type in storageData) {

Просмотреть файл

@ -116,7 +116,7 @@ let DailyInterestsSpout = {
results = this.storage.dayBufferInterests;
this.storage.dayBufferInterests = {};
if (this._emitCallback) {
this.numFromToday = (DateUtils.today() - this.dates[0]);
this.numFromToday = (DateUtils.today() - this.dates[1]);
}
}
return results;