diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2012-08-30 17:58:36 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2012-08-30 17:58:36 +0200 |
commit | ec7da1aac20a01838d30e02d550c13b22414be73 (patch) | |
tree | 8ad108ca47f38e40348941e4c76269f621292e36 /hyperkitty/lib | |
parent | fe5985866065e2b77ef2c6b69e85b60153e89104 (diff) | |
download | hyperkitty-ec7da1aac20a01838d30e02d550c13b22414be73.tar.gz hyperkitty-ec7da1aac20a01838d30e02d550c13b22414be73.tar.xz hyperkitty-ec7da1aac20a01838d30e02d550c13b22414be73.zip |
Adapt to the new Storm-based KittyStore
Diffstat (limited to 'hyperkitty/lib')
-rw-r--r-- | hyperkitty/lib/__init__.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/hyperkitty/lib/__init__.py b/hyperkitty/lib/__init__.py index aa5a3d9..d6ad4aa 100644 --- a/hyperkitty/lib/__init__.py +++ b/hyperkitty/lib/__init__.py @@ -1,7 +1,27 @@ #-*- coding: utf-8 -*- -from hashlib import md5 import urllib +from hashlib import md5 +import threading + +from django.conf import settings + +from hyperkitty.utils import log + +import kittystore + + +class ThreadSafeStorePool(object): + + def __init__(self): + self._local = threading.local() + + def get(self): + try: + return self._local.store + except AttributeError: + self._local.store = kittystore.get_store(settings.KITTYSTORE_URL, debug=False) + return self._local.store def gravatar_url(email): |