allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#5097] Removed --exclude option from taskd due to inefficient query
Date Tue, 09 Oct 2012 21:48:35 GMT
Updated Branches:
  refs/heads/master 9adf82188 -> 5215f01fa


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

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/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/master
Commit: 5215f01fa4b864f1ab00fbd681f7d386304ddf40
Parents: 9adf821
Author: Cory Johns <johnsca@geek.net>
Authored: Tue Oct 9 21:00:14 2012 +0000
Committer: Dave Brondsema <dbrondsema@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(


Mime
View raw message