Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed memcached from dev-instance.

  • Loading branch information...
commit bb125812dc4cdc15e71a07a79ee316f405d1c066 1 parent f6ace56
Anand Chitipothu anandology authored
6 conf/services.ini
View
@@ -7,9 +7,9 @@ stdout_logfile = var/log/solr.log
redirect_stderr = true
priority=100
-[program:memcached]
-command=memcached -p 7060
-priority=100
+; [program:memcached]
+; command=memcached -p 7060
+; priority=100
[program:openlibrary]
command = scripts/openlibrary-server conf/openlibrary.yml --gunicorn -w 2 -b 0.0.0.0:8080 -t 300 --log-level=debug --with-coverstore
13 openlibrary/core/cache.py
View
@@ -60,8 +60,8 @@ def _get_memcache(self):
self._memcache = memcache.Client(servers)
else:
web.debug("Could not find memcache_servers in the configuration. Used dummy memcache.")
- from openlibrary.mocks import mock_memcache
- self._memcache = mock_memcache.Client()
+ import mockcache
+ self._memcache = mockcache.Client()
return self._memcache
@@ -285,8 +285,13 @@ class MemcacheCache(Cache):
"""
@cached_property
def memcache(self):
- servers = config.get("memcache_servers", [])
- return olmemcache.Client(servers)
+ servers = config.get("memcache_servers", None)
+ if servers:
+ return olmemcache.Client(servers)
+ else:
+ web.debug("Could not find memcache_servers in the configuration. Used dummy memcache.")
+ import mockcache
+ return mockcache.Client()
def get(self, key):
key = web.safestr(key)
1  requirements.txt
View
@@ -35,3 +35,4 @@ ordereddict==1.1
py==1.4.5
python-dateutil==1.5
wsgiref==0.1.2
+mockcache==1.0.1
1  setup.py
View
@@ -32,6 +32,7 @@ def executable(path):
sqlalchemy
Pygments
OL-GeoIP
+mockcache
"""
from openlibrary.core.setup_commands import commands
Please sign in to comment.
Something went wrong with that request. Please try again.