Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit d2fc1c4

Browse files
author
Mangled Deutz
committed
Re-activate LRU caching
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
1 parent 56dda3c commit d2fc1c4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docker_registry/lib/cache.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import redis
66

7+
from docker_registry.core import lru
8+
79
from . import config
810

911

@@ -25,6 +27,7 @@ def init():
2527
cache = cfg.cache
2628
if not cache:
2729
return
30+
2831
logging.info('Enabling storage cache on Redis')
2932
if not isinstance(cache, dict):
3033
cache = {}
@@ -37,4 +40,13 @@ def init():
3740
password=redis_opts['password'])
3841
cache_prefix = 'cache_path:{0}'.format(cfg.get('storage_path', '/'))
3942

43+
# Enable the LRU as well
44+
lru.init(
45+
host=redis_opts['host'],
46+
port=int(redis_opts['port']),
47+
db=int(redis_opts['db']),
48+
password=redis_opts['password'],
49+
path=cfg.get('storage_path', '/')
50+
)
51+
4052
init()

0 commit comments

Comments
 (0)