Skip to content
This repository
Browse code

Removed memcached from dev-instance.

  • Loading branch information...
commit bb125812dc4cdc15e71a07a79ee316f405d1c066 1 parent f6ace56
Anand Chitipothu anandology authored
6 conf/services.ini
@@ -7,9 +7,9 @@ stdout_logfile = var/log/solr.log
7 7 redirect_stderr = true
8 8 priority=100
9 9
10   -[program:memcached]
11   -command=memcached -p 7060
12   -priority=100
  10 +; [program:memcached]
  11 +; command=memcached -p 7060
  12 +; priority=100
13 13
14 14 [program:openlibrary]
15 15 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
@@ -60,8 +60,8 @@ def _get_memcache(self):
60 60 self._memcache = memcache.Client(servers)
61 61 else:
62 62 web.debug("Could not find memcache_servers in the configuration. Used dummy memcache.")
63   - from openlibrary.mocks import mock_memcache
64   - self._memcache = mock_memcache.Client()
  63 + import mockcache
  64 + self._memcache = mockcache.Client()
65 65
66 66 return self._memcache
67 67
@@ -285,8 +285,13 @@ class MemcacheCache(Cache):
285 285 """
286 286 @cached_property
287 287 def memcache(self):
288   - servers = config.get("memcache_servers", [])
289   - return olmemcache.Client(servers)
  288 + servers = config.get("memcache_servers", None)
  289 + if servers:
  290 + return olmemcache.Client(servers)
  291 + else:
  292 + web.debug("Could not find memcache_servers in the configuration. Used dummy memcache.")
  293 + import mockcache
  294 + return mockcache.Client()
290 295
291 296 def get(self, key):
292 297 key = web.safestr(key)
1  requirements.txt
@@ -35,3 +35,4 @@ ordereddict==1.1
35 35 py==1.4.5
36 36 python-dateutil==1.5
37 37 wsgiref==0.1.2
  38 +mockcache==1.0.1
1  setup.py
@@ -32,6 +32,7 @@ def executable(path):
32 32 sqlalchemy
33 33 Pygments
34 34 OL-GeoIP
  35 +mockcache
35 36 """
36 37
37 38 from openlibrary.core.setup_commands import commands

0 comments on commit bb12581

Please sign in to comment.
Something went wrong with that request. Please try again.