Author: jfthomps
Date: Thu Apr 28 15:20:22 2011
New Revision: 1097501

URL: http://svn.apache.org/viewvc?rev=1097501&view=rev
Log:
minor changes

modified AJtoggleBlockTime - now we actually delete entries from the request 
table if the start time has not been reached instead of updating the state to 
be deleted.  It's been a while since I did this, but I think the reason was 
that the deleted stated ended up causing the machines to get picked up by the 
reload algorthim.

modified AJupdateBlockStatus - updated to check for computer being in 'reload' 
state in addition to 'reloading' state

Modified:
    incubator/vcl/trunk/web/.ht-inc/blockallocations.php

Modified: incubator/vcl/trunk/web/.ht-inc/blockallocations.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/blockallocations.php?rev=1097501&r1=1097500&r2=1097501&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/blockallocations.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/blockallocations.php Thu Apr 28 15:20:22 
2011
@@ -2714,12 +2714,12 @@ function AJtoggleBlockTime() {
                sendJSON($data);
                return;
        }
-       $query = "UPDATE request "
-              . "SET stateid = 1 "
+       $query = "DELETE FROM request "
               . "WHERE id IN "
               .    "(SELECT DISTINCT reloadrequestid "
-              .    "FROM blockComputers " 
-              .    "WHERE blockTimeid = $timeid)";
+              .    "FROM blockComputers "
+              .    "WHERE blockTimeid = $timeid) AND "
+              .    "stateid = 19";
        doQuery($query, 101);
        $query = "DELETE FROM blockComputers "
               . "WHERE blockTimeid = $timeid";
@@ -2877,10 +2877,11 @@ function AJupdateBlockStatus() {
                foreach($data['comps'] as $id => $comp) {
                        if($comp['state'] == 'available')
                                $available++;
-                       elseif($comp['state'] == 'reloading')
+                       elseif($comp['state'] == 'reload' ||
+                              $comp['state'] == 'reloading')
                                $reloading++;
                        elseif($comp['state'] == 'reserved' ||
-                                        $comp['state'] == 'inuse')
+                              $comp['state'] == 'inuse')
                                $used++;
                }
                $failed = $data['numMachines'] - $available - $reloading - 
$used;


Reply via email to