coren has submitted this change and it was merged.

Change subject: Fix limit detection for status page
......................................................................


Fix limit detection for status page

Most jobs now have two limits, one on h_vmem and one on jobs, which
changes the layout of the data structure parsed from the XML.

Change-Id: Ie6a29b5473fa438940a00817dc58d45fe9d3a980
---
M www/content/status.php
1 file changed, 8 insertions(+), 3 deletions(-)

Approvals:
  coren: Verified; Looks good to me, approved



diff --git a/www/content/status.php b/www/content/status.php
index 0a4bf0b..183e9b7 100644
--- a/www/content/status.php
+++ b/www/content/status.php
@@ -74,9 +74,14 @@
     $j['tool'] = preg_replace('/^local-(.*)$/', "$1", $tool);
     $j['sub'] = $job['JB_submission_time'];
     $j['name'] = $job['JB_job_name'];
-    foreach($job['JB_hard_resource_list'] as $rval) {
-      if($rval['CE_name'] == 'h_vmem') {
-        $j['mem_alloc'] = intval($rval['CE_doubleval']/1048576);
+    foreach($job['JB_hard_resource_list'] as $rvals) {
+      if(!isset($rvals[0])) {
+        $rvals = array($rvals);
+      }
+      foreach($rvals as $rval){
+        if($rval['CE_name'] == 'h_vmem') {
+          $j['mem_alloc'] = intval($rval['CE_doubleval']/1048576);
+        }
       }
     }
     $j['tasks'] = 0;

-- 
To view, visit https://gerrit.wikimedia.org/r/100377
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6a29b5473fa438940a00817dc58d45fe9d3a980
Gerrit-PatchSet: 1
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: coren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to