[xiph-commits] r14671 - in branches/dir.xiph.org: cgi-bin cronjobs
balbinus at svn.xiph.org
balbinus at svn.xiph.org
Mon Apr 7 21:21:38 PDT 2008
Author: balbinus
Date: 2008-04-07 21:21:38 -0700 (Mon, 07 Apr 2008)
New Revision: 14671
Modified:
branches/dir.xiph.org/cgi-bin/yp.php
branches/dir.xiph.org/cronjobs/generate_tagcloud.php
branches/dir.xiph.org/cronjobs/generate_top.php
branches/dir.xiph.org/cronjobs/prune_mountpoints.php
Log:
More Memcache cleanup.
Modified: branches/dir.xiph.org/cgi-bin/yp.php
===================================================================
--- branches/dir.xiph.org/cgi-bin/yp.php 2008-04-08 03:46:07 UTC (rev 14670)
+++ branches/dir.xiph.org/cgi-bin/yp.php 2008-04-08 04:21:38 UTC (rev 14671)
@@ -166,7 +166,7 @@
if ($mp instanceOf Mountpoint && $server instanceOf Server)
{
// Increment the "total servers" key in memcache
- if (!$memcache->increment('servers_total'))
+ if (!$memcache->increment(ENVIRONMENT.'_servers_total'))
{
$memcache->set(ENVIRONMENT.'_servers_total', 1);
}
@@ -263,8 +263,8 @@
if ($res)
{
// Decrement the servers keys in memcache
- $memcache->decrement('servers_total');
- $memcache->decrement('servers_'.intval($media_type));
+ $memcache->decrement(ENVIRONMENT.'_servers_total');
+ $memcache->decrement(ENVIRONMENT.'_servers_'.intval($media_type));
// Decrement the tag cloud values
/* $query = 'UPDATE `tag_cloud` SET `tag_usage` = `tag_usage` - 1 WHERE `tag_name` IN (SELECT `tag_id` FROM `mountpoints_tags` WHERE `mountpoint_id` = %d);';
Modified: branches/dir.xiph.org/cronjobs/generate_tagcloud.php
===================================================================
--- branches/dir.xiph.org/cronjobs/generate_tagcloud.php 2008-04-08 03:46:07 UTC (rev 14670)
+++ branches/dir.xiph.org/cronjobs/generate_tagcloud.php 2008-04-08 04:21:38 UTC (rev 14671)
@@ -47,7 +47,7 @@
$res = array_map('add_popularity', $res);
var_dump($res);
// Save into memcache
-$memcache->set('prod_tagcloud', $res, 0, 600); // 10 mins
+$memcache->set(ENVIRONMENT.'_tagcloud', $res, 0, 600); // 10 mins
echo "OK.\n";
?>
Modified: branches/dir.xiph.org/cronjobs/generate_top.php
===================================================================
--- branches/dir.xiph.org/cronjobs/generate_top.php 2008-04-08 03:46:07 UTC (rev 14670)
+++ branches/dir.xiph.org/cronjobs/generate_top.php 2008-04-08 04:21:38 UTC (rev 14671)
@@ -79,7 +79,7 @@
}
// array_slice($data, 0, MAX_STREAMS_ON_HOMEPAGE)
-$memcache->set('prod_home_top', $data, false, 120) or die("Unable to save data on the Memcache server.\n");
+$memcache->set(ENVIRONMENT.'_home_top', $data, false, 120) or die("Unable to save data on the Memcache server.\n");
echo("OK.\n");
?>
Modified: branches/dir.xiph.org/cronjobs/prune_mountpoints.php
===================================================================
--- branches/dir.xiph.org/cronjobs/prune_mountpoints.php 2008-04-08 03:46:07 UTC (rev 14670)
+++ branches/dir.xiph.org/cronjobs/prune_mountpoints.php 2008-04-08 04:21:38 UTC (rev 14671)
@@ -17,7 +17,7 @@
// Old stuff that "timeouted"
$db->noReturnQuery('DELETE FROM `server` WHERE `last_touched_at` <= DATE_SUB(NOW(), INTERVAL 30 MINUTE);');
$nb = $db->affected_rows;
-$memcache->decrement('servers', $nb);
+$memcache->decrement(ENVIRONMENT.'_servers', $nb);
// Useless mountpoint
try
More information about the commits
mailing list