You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2012/10/11 21:58:52 UTC

[12/21] git commit: [#5097] Removed --exclude option from taskd due to inefficient query

[#5097] Removed --exclude option from taskd due to inefficient query

Signed-off-by: Cory Johns <jo...@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/5215f01f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/5215f01f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/5215f01f

Branch: refs/heads/cj/4942
Commit: 5215f01fa4b864f1ab00fbd681f7d386304ddf40
Parents: 9adf821
Author: Cory Johns <jo...@geek.net>
Authored: Tue Oct 9 21:00:14 2012 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Tue Oct 9 21:48:23 2012 +0000

----------------------------------------------------------------------
 Allura/allura/command/taskd.py    |    8 +-------
 Allura/allura/model/monq_model.py |    4 +---
 2 files changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5215f01f/Allura/allura/command/taskd.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/taskd.py b/Allura/allura/command/taskd.py
index 12736a5..554efdb 100644
--- a/Allura/allura/command/taskd.py
+++ b/Allura/allura/command/taskd.py
@@ -21,8 +21,6 @@ class TaskdCommand(base.Command):
     parser = base.Command.standard_parser(verbose=True)
     parser.add_option('--only', dest='only', type='string', default=None,
                       help='only handle tasks of the given name(s) (can be comma-separated list)')
-    parser.add_option('--exclude', dest='exclude', type='string', default=None,
-                      help='never handle tasks of the given name(s) (can be comma-separated list)')
 
     def command(self):
         self.basic_setup()
@@ -60,9 +58,6 @@ class TaskdCommand(base.Command):
         only = self.options.only
         if only:
             only = only.split(',')
-        exclude = self.options.exclude
-        if exclude:
-            exclude = exclude.split(',')
 
         def start_response(status, headers, exc_info=None):
             pass
@@ -95,8 +90,7 @@ class TaskdCommand(base.Command):
                     self.task = M.MonQTask.get(
                             process=name,
                             waitfunc=waitfunc,
-                            only=only,
-                            exclude=exclude)
+                            only=only)
                     if self.task:
                         # Build the (fake) request
                         r = Request.blank('/--%s--/' % self.task.task_name, dict(task=self.task))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5215f01f/Allura/allura/model/monq_model.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/monq_model.py b/Allura/allura/model/monq_model.py
index d22d65e..9964fc8 100644
--- a/Allura/allura/model/monq_model.py
+++ b/Allura/allura/model/monq_model.py
@@ -147,7 +147,7 @@ class MonQTask(MappedClass):
         return obj
 
     @classmethod
-    def get(cls, process='worker', state='ready', waitfunc=None, only=None, exclude=None):
+    def get(cls, process='worker', state='ready', waitfunc=None, only=None):
         '''Get the highest-priority, oldest, ready task and lock it to the
         current process.  If no task is available and waitfunc is supplied, call
         the waitfunc before trying to get the task again.  If waitfunc is None
@@ -159,8 +159,6 @@ class MonQTask(MappedClass):
         while True:
             try:
                 query = dict(state=state)
-                if exclude:
-                    query['task_name'] = {'$nin': exclude}
                 if only:
                     query['task_name'] = {'$in': only}
                 obj = cls.query.find_and_modify(