incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [15/26] git commit: [#4927] Minor change to avoid extra query against task queue
Date Fri, 26 Oct 2012 19:33:22 GMT
[#4927] Minor change to avoid extra query against task queue

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

Branch: refs/heads/cj/4942
Commit: b423033825a284f250d0a1adc538b5bd807738c9
Parents: 1e5d676
Author: Cory Johns <johnsca@geek.net>
Authored: Mon Oct 15 20:22:18 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Mon Oct 15 20:23:08 2012 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/repo_tasks.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b4230338/Allura/allura/tasks/repo_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/repo_tasks.py b/Allura/allura/tasks/repo_tasks.py
index 97c376e..1767a41 100644
--- a/Allura/allura/tasks/repo_tasks.py
+++ b/Allura/allura/tasks/repo_tasks.py
@@ -93,13 +93,11 @@ def refresh(**kwargs):
     #don't create multiple refresh tasks
     q = {
         'task_name': 'allura.tasks.repo_tasks.refresh',
-        'state': 'busy',
+        'state': {'$in': ['busy', 'ready']},
         'context.app_config_id': c.app.config._id,
         'context.project_id': c.project._id,
     }
     refresh_tasks_count = M.MonQTask.query.find(q).count()
-    q['state'] = 'ready'
-    refresh_tasks_count += M.MonQTask.query.find(q).count()
     if refresh_tasks_count <= 1: #only this task
         c.app.repo.refresh()
         #checking if we have new commits arrived


Mime
View raw message