incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/6] git commit: [#7178] Always return a MockSOLR instead of None, since things break without it
Date Tue, 04 Mar 2014 18:40:42 GMT
Repository: incubator-allura
Updated Branches:
  refs/heads/cj/7204 3b1b9dae6 -> da9227258 (forced update)


[#7178] Always return a MockSOLR instead of None, since things break without it

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/cj/7204
Commit: dc4ca356e10b9ede614eab783ae4e80089c78b14
Parents: 8fbd4d6
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Wed Feb 26 20:58:44 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Mar 4 16:33:17 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dc4ca356/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index f46c1eb..9548cac 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -150,17 +150,15 @@ class Globals(object):
         # skip empty strings in case of extra commas
         self.solr_server = [s for s in self.solr_server if s]
         self.solr_query_server = config.get('solr.query_server')
-        if asbool(config.get('solr.mock')):
-            self.solr = self.solr_short_timeout = MockSOLR()
-        elif self.solr_server:
+        if self.solr_server:
             self.solr = make_solr_from_config(
                 self.solr_server, self.solr_query_server)
             self.solr_short_timeout = make_solr_from_config(
                 self.solr_server, self.solr_query_server,
                 timeout=int(config.get('solr.short_timeout', 10)))
         else:  # pragma no cover
-            self.solr = None
-            self.solr_short_timeout = None
+            log.warning('Solr config not set; using in-memory MockSOLR')
+            self.solr = self.solr_short_timeout = MockSOLR()
         self.use_queue = asbool(config.get('use_queue', False))
 
         # Load login/logout urls; only used for customized logins


Mime
View raw message