Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use a different set of memcaches for locking.

  • Loading branch information...
commit ab039b4722607ce4048d21a3ef9ca5cdd40a6fc4 1 parent 76142d5
@spladug spladug authored
Showing with 6 additions and 1 deletion.
  1. +2 −0  r2/example.ini
  2. +4 −1 r2/r2/lib/app_globals.py
View
2  r2/example.ini
@@ -119,6 +119,8 @@ admin_message_acct = reddit
# data cache (used for caching Thing objects)
num_mc_clients = 5
memcaches = 127.0.0.1:11211
+# caches to use for locking
+lockcaches = 127.0.0.1:11211
stalecaches =
# render caches (the second is "remote" and the local is optional but in the same format)
local_rendercache =
View
5 r2/r2/lib/app_globals.py
@@ -172,6 +172,7 @@ class Globals(object):
ConfigValue.tuple: [
'stalecaches',
'memcaches',
+ 'lockcaches',
'permacache_memcaches',
'rendercaches',
'cassandra_seeds',
@@ -276,8 +277,10 @@ def setup(self):
self.cache_chains = {}
+ self.lock_cache = CMemcache(self.lockcaches, num_clients=num_mc_clients)
+ self.make_lock = make_lock_factory(self.lock_cache)
+
self.memcache = CMemcache(self.memcaches, num_clients = num_mc_clients)
- self.make_lock = make_lock_factory(self.memcache)
self.stats = Stats(self.config.get('statsd_addr'),
self.config.get('statsd_sample_rate'))
Please sign in to comment.
Something went wrong with that request. Please try again.