[xiph-commits] r14861 - branches/dir.xiph.org/cronjobs

balbinus at svn.xiph.org balbinus at svn.xiph.org
Sun May 11 08:01:03 PDT 2008


Author: balbinus
Date: 2008-05-11 08:01:03 -0700 (Sun, 11 May 2008)
New Revision: 14861

Modified:
   branches/dir.xiph.org/cronjobs/check_servers.php
   branches/dir.xiph.org/cronjobs/prune_mountpoints.php
Log:
Wrong var name in prune_mountpoints that prevented anything from being pruned + check that we actually get a mountpoint back in check_servers.

Modified: branches/dir.xiph.org/cronjobs/check_servers.php
===================================================================
--- branches/dir.xiph.org/cronjobs/check_servers.php	2008-05-11 01:35:59 UTC (rev 14860)
+++ branches/dir.xiph.org/cronjobs/check_servers.php	2008-05-11 15:01:03 UTC (rev 14861)
@@ -88,7 +88,7 @@
                 }
                 while (trim($data) != '' && $r < 10);
                 
-                // Extremely dangerous, desactivated.
+                // Extremely dangerous, disabled.
 /*              if (!array_key_exists('server', $headers)
                     || !stristr($headers['server'], 'icecast'))
                 {
@@ -119,12 +119,13 @@
             $db->noReturnQuery($sql);*/
             $server = Server::retrieveByPk($res->current('id'));
             $mp_id = $server->getMountpointId();
-            $mountpoint = Mountpoint::retrieveByPk($mp_id);
-            $server->remove();
-            if (!$mountpoint->hasLinkedServers())
-            {
-            	$mountpoint->remove();
-            }
+	        $mountpoint = Mountpoint::retrieveByPk($mp_id);
+	        $server->remove();
+	        if ($mountpoint instanceOf Mountpoint
+	        	&& !$mountpoint->hasLinkedServers())
+	        {
+	        	$mountpoint->remove();
+	        }
         }
         
         $res->next();

Modified: branches/dir.xiph.org/cronjobs/prune_mountpoints.php
===================================================================
--- branches/dir.xiph.org/cronjobs/prune_mountpoints.php	2008-05-11 01:35:59 UTC (rev 14860)
+++ branches/dir.xiph.org/cronjobs/prune_mountpoints.php	2008-05-11 15:01:03 UTC (rev 14861)
@@ -16,7 +16,7 @@
 	
 	while (!$toDelete->endOf())
 	{
-        $server = Server::retrieveByPk($res->current('id'));
+        $server = Server::retrieveByPk($toDelete->current('id'));
         $mp_id = $server->getMountpointId();
         $mountpoint = Mountpoint::retrieveByPk($mp_id);
         $server->remove();



More information about the commits mailing list