incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#5097] Removed --exclude option from taskd due to inefficient query
Date Tue, 09 Oct 2012 21:00:29 GMT
Updated Branches:
  refs/heads/cj/5097 [created] 0f40a5b4c


[#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/0f40a5b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0f40a5b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0f40a5b4

Branch: refs/heads/cj/5097
Commit: 0f40a5b4c78f5382f4e4837590802e3e85ec4204
Parents: 9d15a0e
Author: Cory Johns <johnsca@geek.net>
Authored: Tue Oct 9 21:00:14 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Tue Oct 9 21:00:14 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/0f40a5b4/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/0f40a5b4/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