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/15 23:18:56 UTC

[2/7] git commit: [#4927] Minor change to avoid extra query against task queue

[#4927] Minor change to avoid extra query against task queue

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/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/master
Commit: b423033825a284f250d0a1adc538b5bd807738c9
Parents: 1e5d676
Author: Cory Johns <jo...@geek.net>
Authored: Mon Oct 15 20:22:18 2012 +0000
Committer: Cory Johns <jo...@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