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

dm8tbr at svn.xiph.org dm8tbr at svn.xiph.org
Sun Nov 18 05:43:39 PST 2012


Author: dm8tbr
Date: 2012-11-18 05:43:39 -0800 (Sun, 18 Nov 2012)
New Revision: 18708

Modified:
   branches/dir.xiph.org/cronjobs/check_servers.sh
   branches/dir.xiph.org/cronjobs/generate_xml.php
   branches/dir.xiph.org/cronjobs/prune_mountpoints.php
Log:
Cronjob fixes for dir.xiph.org.
 * More memory for XML generation (otherwise it fails during times with >>15k streams)
 * Better logging for clean up
 * Longer timeout (just in case, doesn't seem to be necessary though)
 * cosmetic fix so that the job does not return 2 but 0. Reduces log output.


Modified: branches/dir.xiph.org/cronjobs/check_servers.sh
===================================================================
--- branches/dir.xiph.org/cronjobs/check_servers.sh	2012-11-18 13:37:03 UTC (rev 18707)
+++ branches/dir.xiph.org/cronjobs/check_servers.sh	2012-11-18 13:43:39 UTC (rev 18708)
@@ -12,7 +12,7 @@
 if [ -f "$LOCKFILE" ]
 then
 	echo "An instance is already running."
-	exit 2
+	exit 0
 else
 	echo "Creating lockfile..."
 	touch "$LOCKFILE"

Modified: branches/dir.xiph.org/cronjobs/generate_xml.php
===================================================================
--- branches/dir.xiph.org/cronjobs/generate_xml.php	2012-11-18 13:37:03 UTC (rev 18707)
+++ branches/dir.xiph.org/cronjobs/generate_xml.php	2012-11-18 13:43:39 UTC (rev 18708)
@@ -3,7 +3,7 @@
 // Inclusions
 include_once(dirname(__FILE__).'/../inc/prepend.php');
 
-ini_set('memory_limit', '64M');
+ini_set('memory_limit', '128M');
 
 define('XML_OUTPUT', dirname(__FILE__).'/../yp.xml');
 

Modified: branches/dir.xiph.org/cronjobs/prune_mountpoints.php
===================================================================
--- branches/dir.xiph.org/cronjobs/prune_mountpoints.php	2012-11-18 13:37:03 UTC (rev 18707)
+++ branches/dir.xiph.org/cronjobs/prune_mountpoints.php	2012-11-18 13:43:39 UTC (rev 18708)
@@ -12,20 +12,22 @@
 // Old stuff that "timeouted"
 try
 {
-	$toDelete = $db->selectQuery('SELECT `id` FROM `server` WHERE `last_touched_at` <= DATE_SUB(NOW(), INTERVAL 10 MINUTE);');
+	$toDelete = $db->selectQuery('SELECT `id` FROM `server` WHERE `last_touched_at` <= DATE_SUB(NOW(), INTERVAL 20 MINUTE);');
 	
 	while (!$toDelete->endOf())
 	{
-	printf("Processing %s... ", $toDelete->current('id'));
+	printf("%s Processing %s... ", date(DATE_ATOM), $toDelete->current('id'));
         $server = Server::retrieveByPk($toDelete->current('id'));
         $mp_id = $server->getMountpointId();
         $mountpoint = Mountpoint::retrieveByPk($mp_id);
         $server->remove();
-	echo "ok.\n";
         if ($mountpoint instanceOf Mountpoint && !$mountpoint->hasLinkedServers())
         {
         	$mountpoint->remove();
+		printf("removing mountpoint... ");
         }
+
+	echo "ok.\n";
 		
 		// Next!
 		$toDelete->next();



More information about the commits mailing list