incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [3/7] git commit: [#5697] Removed decorator only used in one spot
Date Tue, 29 Jan 2013 19:21:55 GMT
[#5697] Removed decorator only used in one spot

Signed-off-by: Cory Johns <johnsca@geek.net>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/97ec0fe0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/97ec0fe0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/97ec0fe0

Branch: refs/heads/cj/5697
Commit: 97ec0fe092dc2a9a880868c2961bca10e2498180
Parents: db18286
Author: Cory Johns <johnsca@geek.net>
Authored: Tue Jan 29 16:15:21 2013 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Tue Jan 29 17:05:36 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/search.py |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/97ec0fe0/Allura/allura/lib/search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index 11b5ed3..dc86b30 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -13,14 +13,6 @@ from .markdown_extensions import ForgeExtension
 
 log = getLogger(__name__)
 
-def try_solr(func):
-    def inner(*args, **kwargs):
-        try:
-            return func(*args, **kwargs)
-        except: # pragma no cover
-            log.exception('Error in solr indexing')
-    return inner
-
 def solarize(obj):
     if obj is None: return None
     doc = obj.index()
@@ -34,12 +26,14 @@ def solarize(obj):
     doc['text'] = text
     return doc
 
-@try_solr
 def search(q,short_timeout=False,**kw):
-    if short_timeout:
-        return g.solr_short_timeout.search(q, **kw)
-    else:
-        return g.solr.search(q, **kw)
+    try:
+        if short_timeout:
+            return g.solr_short_timeout.search(q, **kw)
+        else:
+            return g.solr.search(q, **kw)
+    except pysolr.SolrError as e:
+        log.exception('Error in solr indexing')
 
 def search_artifact(atype, q, history=False, rows=10, short_timeout=False, **kw):
     """Performs SOLR search.


Mime
View raw message