summaryrefslogtreecommitdiffstats
path: root/hyperkitty/lib
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2012-08-30 17:58:36 +0200
committerAurélien Bompard <aurelien@bompard.org>2012-08-30 17:58:36 +0200
commitec7da1aac20a01838d30e02d550c13b22414be73 (patch)
tree8ad108ca47f38e40348941e4c76269f621292e36 /hyperkitty/lib
parentfe5985866065e2b77ef2c6b69e85b60153e89104 (diff)
downloadhyperkitty-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__.py22
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):