Use a define instead of magic numbers for number of builds to maintain.

Set number of builds to keep to 50
This commit is contained in:
Latif Khalifa
2013-02-04 03:14:42 +01:00
parent 0cd36c18e9
commit ba95bc5b2b
3 changed files with 3 additions and 2 deletions

View File

@@ -155,7 +155,7 @@ if (isset($_GET["chan"]) && isset($CHANS[$_GET["chan"]])) {
$chan = "SingularityAlpha";
}
$pageSize = 20;
$pageSize = KEEP_BUILDS;
$builds = array();

View File

@@ -37,7 +37,7 @@ function get_old_builds($chan, $nrToKeep)
}
chdir(SITE_ROOT);
$builds = get_old_builds("SingularityAlpha", 21);
$builds = get_old_builds("SingularityAlpha", KEEP_BUILDS + 1);
$nrBuilds = count($builds);
for ($i=0; $i<$nrBuilds; $i++) {

View File

@@ -57,6 +57,7 @@ if (!defined('IMG_ROOT')) {
// $CHANS = array("SingularityAlpha" => "HEAD", "SingularityMultiWearable" => "refs/remotes/shyotl/V2MultiWear");
$CHANS = array("SingularityAlpha" => "HEAD");
define("KEEP_BUILDS", 50);
$DB = new DBH();