Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use LRU cache by default
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Aug 5, 2015
1 parent 7148aaf commit a89559d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions synapse/storage/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

class Cache(object):

def __init__(self, name, max_entries=1000, keylen=1, lru=False):
def __init__(self, name, max_entries=1000, keylen=1, lru=True):
if lru:
self.cache = LruCache(max_size=max_entries)
self.max_entries = None
Expand Down Expand Up @@ -141,7 +141,7 @@ class CacheDescriptor(object):
which can be used to insert values into the cache specifically, without
calling the calculation function.
"""
def __init__(self, orig, max_entries=1000, num_args=1, lru=False):
def __init__(self, orig, max_entries=1000, num_args=1, lru=True):
self.orig = orig

self.max_entries = max_entries
Expand Down Expand Up @@ -192,7 +192,7 @@ def wrapped(*keyargs):
return wrapped


def cached(max_entries=1000, num_args=1, lru=False):
def cached(max_entries=1000, num_args=1, lru=True):
return lambda orig: CacheDescriptor(
orig,
max_entries=max_entries,
Expand Down

0 comments on commit a89559d

Please sign in to comment.