aboutsummaryrefslogtreecommitdiffstats
path: root/lib/LXRng/Cached.pm
diff options
context:
space:
mode:
authorArne Georg Gleditsch <argggh@lxr.linpro.no>2008-02-07 20:31:11 +0100
committerArne Georg Gleditsch <argggh@lxr.linpro.no>2008-02-07 20:31:11 +0100
commit378a912bf79e1e5b6384b02b14919371ac0c4785 (patch)
treea7969b83c550188e093ac7e5b4aa5a6542908fd5 /lib/LXRng/Cached.pm
parentf5277f0a49bfb6eb48c27de4d644b2f9e2f94e4f (diff)
Provisions for mod_perl use, take one.
Diffstat (limited to 'lib/LXRng/Cached.pm')
-rw-r--r--lib/LXRng/Cached.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/LXRng/Cached.pm b/lib/LXRng/Cached.pm
index 9c30d82..f27d3c2 100644
--- a/lib/LXRng/Cached.pm
+++ b/lib/LXRng/Cached.pm
@@ -1,6 +1,8 @@
package LXRng::Cached;
use strict;
+use LXRng;
+
require Exporter;
use vars qw($memcached @ISA @EXPORT);
@ISA = qw(Exporter);
@@ -12,9 +14,11 @@ BEGIN {
require Digest::SHA1;
};
if ($@ eq '') {
+ my $nspace = substr(Digest::SHA1::sha1_hex($LXRng::ROOT), 0, 8);
+
$memcached = Cache::Memcached->new({
'servers' => ['127.0.0.1:11211'],
- 'namespace' => 'lxrng'});
+ 'namespace' => 'lxrng:$nspace'});
$memcached = undef
unless ($memcached->set(':caching' => 1))
}