allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#7145] Changed solr call for deleting a tool to a background task
Date Mon, 04 Apr 2016 19:44:49 GMT
Repository: allura
Updated Branches:
  refs/heads/master 60ca3e807 -> 7d8abd322


[#7145] Changed solr call for deleting a tool to a background task


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

Branch: refs/heads/master
Commit: 7d8abd3222ba666f2503e995834247f2e48d2c2e
Parents: 60ca3e8
Author: rhnvrm <rohanverma2004@gmail.com>
Authored: Sun Apr 3 01:17:36 2016 +0530
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Apr 4 15:27:02 2016 -0400

----------------------------------------------------------------------
 Allura/allura/app.py               | 5 +++--
 Allura/allura/tasks/index_tasks.py | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/7d8abd32/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 0844c94..1e803a8 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -46,6 +46,7 @@ from allura.controllers import BaseController
 from allura.lib.decorators import require_post, memoize
 from allura.lib.utils import permanent_redirect, ConfigProxy
 from allura import model as M
+from allura.tasks import index_tasks
 
 log = logging.getLogger(__name__)
 
@@ -541,8 +542,8 @@ class Application(object):
         if project_id is None:
             project_id = project._id
         # De-index all the artifacts belonging to this tool in one fell swoop
-        g.solr.delete(q='project_id_s:"%s" AND mount_point_s:"%s"' % (
-            project_id, self.config.options['mount_point']))
+        index_tasks.solr_del_tool.post(project_id, self.config.options['mount_point'])
+        
         for d in model.Discussion.query.find({
                 'project_id': project_id,
                 'app_config_id': self.config._id}):

http://git-wip-us.apache.org/repos/asf/allura/blob/7d8abd32/Allura/allura/tasks/index_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/index_tasks.py b/Allura/allura/tasks/index_tasks.py
index f5715b8..916c6fd 100644
--- a/Allura/allura/tasks/index_tasks.py
+++ b/Allura/allura/tasks/index_tasks.py
@@ -130,6 +130,10 @@ def commit():
     g.solr.commit()
 
 
+@task
+def solr_del_tool(project_id, mount_point_s):
+    g.solr.delete(q='project_id_s:"%s" AND mount_point_s:"%s"' % (project_id, mount_point_s))
+
 @contextmanager
 def _indexing_disabled(session):
     session.disable_index = session.skip_mod_date = True


Mime
View raw message