diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2012-09-06 11:08:10 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2012-09-06 11:08:10 +0200 |
commit | 9877360a7f81943239d852de14eebf8be7674ad5 (patch) | |
tree | 835d3adec2ec9eba46233f5d7724aea9af4ceece /hyperkitty/api.py | |
parent | 54f6eb7982a562a3526ee3b9be62fa6e9344dbdb (diff) | |
download | hyperkitty-9877360a7f81943239d852de14eebf8be7674ad5.tar.gz hyperkitty-9877360a7f81943239d852de14eebf8be7674ad5.tar.xz hyperkitty-9877360a7f81943239d852de14eebf8be7674ad5.zip |
Move the store pool to HyperKitty
Diffstat (limited to 'hyperkitty/api.py')
-rw-r--r-- | hyperkitty/api.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/hyperkitty/api.py b/hyperkitty/api.py index 1e8a05f..e085139 100644 --- a/hyperkitty/api.py +++ b/hyperkitty/api.py @@ -7,8 +7,9 @@ from django.http import HttpResponseNotModified, HttpResponse import json import re +from kittystore import get_store + from hyperkitty.utils import log -from hyperkitty.lib import ThreadSafeStorePool class EmailResource(View): @@ -18,8 +19,8 @@ class EmailResource(View): def get(self, request, mlist_fqdn, messageid): list_name = mlist_fqdn.split('@')[0] - STORE = ThreadSafeStorePool().get() - email = STORE.get_message_by_hash_from_list(list_name, messageid) + store = get_store(settings.KITTYSTORE_URL) + email = store.get_message_by_hash_from_list(list_name, messageid) if not email: return HttpResponse(status=404) else: @@ -33,8 +34,8 @@ class ThreadResource(View): def get(self, request, mlist_fqdn, threadid): list_name = mlist_fqdn.split('@')[0] - STORE = ThreadSafeStorePool().get() - thread = STORE.get_messages_in_thread(list_name, threadid) + store = get_store(settings.KITTYSTORE_URL) + thread = store.get_messages_in_thread(list_name, threadid) if not thread: return HttpResponse(status=404) else: @@ -62,8 +63,8 @@ class SearchResource(View): re.compile(regex, re.IGNORECASE)} #print query_string, field, keyword - STORE = ThreadSafeStorePool().get() - threads = STORE.search_archives(list_name, query_string) + store = get_store(settings.KITTYSTORE_URL) + threads = store.search_archives(list_name, query_string) if not threads: return HttpResponse(status=404) else: |