Browse files

if someone else (e.g., interlock) has already set up memcached, then …

…don't try to do it ourselves

Signed-off-by: Chris Wanstrath <chris@ozmm.org>
  • Loading branch information...
1 parent 7aa8de6 commit 505a8324e650fcbc016f920c5dc51b1bfa62296b @lovitt lovitt committed with Sep 3, 2008
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/acts_as_cached/config.rb
View
4 lib/acts_as_cached/config.rb
@@ -43,6 +43,10 @@ def setup_cache_store!(config)
def setup_memcache(config)
config[:namespace] << "-#{RAILS_ENV}"
+ # if someone (e.g., interlock) already set up memcached, then
+ # we need to stop here
+ return CACHE if Object.const_defined?(:CACHE)
+
silence_warnings do
Object.const_set :CACHE, memcache_client(config)
Object.const_set :SESSION_CACHE, memcache_client(config) if config[:session_servers]

0 comments on commit 505a832

Please sign in to comment.