Don't query the inbetween data by default. Only when definitely needed.

This commit is contained in:
Hannes Verschore 2015-12-03 07:07:42 -08:00
Родитель c5df7750a0
Коммит 9fb1789719
3 изменённых файлов: 26 добавлений и 6 удалений

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

@ -0,0 +1,23 @@
<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
require_once("../internals.php");
init_database();
require_once("data-func.php");
require_once("../lib/RetriggerController.php");
require_once("../lib/DB/Regression.php");
require_once("../lib/RegressionTools.php");
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$regression = Regression::FromId((int)$request->id);
$inbetween = Array();
foreach (RegressionTools::inbetweenBuilds($regression) as $build) {
$inbetween[] = $build->revision();
}
echo json_encode($inbetween);

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

@ -55,12 +55,6 @@ for ($i=0; $i < count($ids); $i++) {
$db_build->mode_id())
);
$inbetween = Array();
foreach (RegressionTools::inbetweenBuilds($db_regression) as $build) {
$inbetween[] = $build->revision();
}
$regression["inbetween"] = $inbetween;
$qScores = mysql_query("SELECT * FROM awfy_regression_score
WHERE regression_id = '".$regression["id"]."'") or die(mysql_error());
while ($scores = mysql_fetch_assoc($qScores)) {

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

@ -74,6 +74,9 @@ awfyCtrl.controller('regressionCtrl', ['$scope', '$http', '$routeParams', '$q',
$http.post('data-regression-range.php', {id:regression_id}).then(function(data){
$scope.regression.range = data.data
});
$http.post('data-regression-inbetween.php', {id:regression_id}).then(function(data){
$scope.regression.inbetween = data.data
});
});
$scope.statusPopup = function(regression) {