summaryrefslogtreecommitdiffstats
path: root/hyperkitty/lib
diff options
context:
space:
mode:
Diffstat (limited to 'hyperkitty/lib')
-rw-r--r--hyperkitty/lib/__init__.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/hyperkitty/lib/__init__.py b/hyperkitty/lib/__init__.py
index d6ad4aa..887cfd5 100644
--- a/hyperkitty/lib/__init__.py
+++ b/hyperkitty/lib/__init__.py
@@ -12,16 +12,19 @@ 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
+ """
+ http://unpythonic.blogspot.fr/2007/11/using-storm-and-sqlite-in-multithreaded.html
+ """
+
+ 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):