From f403368dcdeb88f53f05cf618030497ee5e8b95b Mon Sep 17 00:00:00 2001 From: Bruce Allen Date: Wed, 29 Jun 2005 14:01:41 +0000 Subject: [PATCH] Clearer output svn path=/trunk/boinc/; revision=6495 --- html/ops/grant_credit.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/html/ops/grant_credit.php b/html/ops/grant_credit.php index c2d6ec7d7a..27bd2f3b5f 100644 --- a/html/ops/grant_credit.php +++ b/html/ops/grant_credit.php @@ -28,9 +28,13 @@ function testquery($argstring) { } function grant_credits_for_wu($wuid) { + + $ndone = 0; $query_r = mysql_query("select * from result where granted_credit=0 and claimed_credit>0 and workunitid=$wuid"); + while ($result = mysql_fetch_object($query_r)) { - echo "STARTING RESULT $result->id [Credit $result->claimed_credit]\n"; + echo "STARTING RESULT $result->id [Credit $result->claimed_credit] ..."; + $ndone++; $hostid = $result->hostid; $query_h = mysql_query("select * from host where id=$hostid"); @@ -71,21 +75,23 @@ function grant_credits_for_wu($wuid) { } mysql_free_result($query_h); mysql_free_result($query_u); - echo "DONE WITH RESULT $result->id\n\n"; + echo " DONE\n"; } mysql_free_result($query_r); - return; + return $ndone; } function grant_credits_for_cancelled() { - + $ngranted=0; $query_w = mysql_query("select * from workunit where error_mask!=0"); while (($workunit = mysql_fetch_object($query_w))) { - echo "Starting WU $workunit->id\n"; - grant_credits_for_wu($workunit->id); + // echo "Starting WU $workunit->id\n"; + $ngranted += grant_credits_for_wu($workunit->id); // NEED TO SET assimilate_state=READY for WU!! } mysql_free_result($query_w); + + echo "\nGranted credits to $ngranted results\n"; } grant_credits_for_cancelled();