Skip to content

Commit

Permalink
Revert back to memoize, deprecated but not yet removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
danpalmer committed Feb 27, 2015
1 parent dae31b8 commit 06cada7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions django_lightweight_queue/utils.py
Expand Up @@ -3,7 +3,7 @@

from django.apps import apps
from django.core.exceptions import MiddlewareNotUsed
from django.utils.lru_cache import lru_cache
from django.utils.functional import memoize
from django.utils.module_loading import module_has_submodule

from . import app_settings
Expand All @@ -29,19 +29,16 @@ def configure_logging(level, format, filename):
if level is not None:
logging.root.setLevel(level)

@lru_cache
def get_path(path):
module_name, attr = path.rsplit('.', 1)

module = importlib.import_module(module_name)

return getattr(module, attr)

@lru_cache
def get_backend():
return get_path(app_settings.BACKEND)()

@lru_cache
def get_middleware():
middleware = []

Expand Down Expand Up @@ -76,3 +73,7 @@ def set_process_title(*titles):
except ImportError:
def set_process_title(*titles):
pass

get_path = memoize(get_path, {}, 1)
get_backend = memoize(get_backend, {}, 0)
get_middleware = memoize(get_middleware, {}, 0)

1 comment on commit 06cada7

@lamby
Copy link
Contributor

@lamby lamby commented on 06cada7 Aug 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has now been removed: django/django@61ad1ea

Please sign in to comment.