From 7dabfc3c45f6082573d0ce2c5f66fb04fa1e8c86 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 19 May 2020 13:29:31 +0200 Subject: [remoteaccess] Remove TODO and debug spam --- modules-available/remoteaccess/inc/remoteaccess.inc.php | 7 +++---- modules-available/remoteaccess/page.inc.php | 6 ------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/modules-available/remoteaccess/inc/remoteaccess.inc.php b/modules-available/remoteaccess/inc/remoteaccess.inc.php index 1dbe02c3..fc719b37 100644 --- a/modules-available/remoteaccess/inc/remoteaccess.inc.php +++ b/modules-available/remoteaccess/inc/remoteaccess.inc.php @@ -34,7 +34,8 @@ class RemoteAccess $active = Database::queryFirst("SELECT Count(*) AS cnt FROM machine m INNER JOIN remoteaccess_machine rm USING (machineuuid) WHERE m.locationid IN ($locs) AND m.state = 'IDLE'"); - $wantNum = $row['wolcount'] - (isset($active['cnt']) ? $active['cnt'] : 0); + $active = (isset($active['cnt']) ? $active['cnt'] : 0); + $wantNum = $row['wolcount'] - $active; if ($wantNum <= 0) continue; self::tryWakeMachines($locs, $wantNum); @@ -59,11 +60,9 @@ class RemoteAccess } if (empty($list)) break; // No more clients in this location - error_log('Trying to wake ' . count($list) . " in $locs"); RebootControl::wakeMachines($list, $fails); $num -= count($list) - count($fails); if (!empty($fails)) { - error_log(count($fails) . ' failed'); $failIds = ArrayUtil::flattenByKey($fails, 'machineuuid'); // Reduce time so they won't be marked as wol_in_progress Database::exec('UPDATE remoteaccess_machine SET woltime = :faketime WHERE machineuuid IN (:fails)', @@ -71,7 +70,7 @@ class RemoteAccess } } if ($num > 0) { - error_log("Could not wake $num clients..."); + error_log("Could not wake $num clients in ($locs)..."); } } diff --git a/modules-available/remoteaccess/page.inc.php b/modules-available/remoteaccess/page.inc.php index 27b7ca6b..68781ffa 100644 --- a/modules-available/remoteaccess/page.inc.php +++ b/modules-available/remoteaccess/page.inc.php @@ -1,11 +1,5 @@