diff pylons_app/controllers/admin/settings.py @ 467:3fc3ce53659b celery

starting celery branch
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 11 Sep 2010 01:55:46 +0200
parents a0a93357f954
children 6b934c9607e7
line wrap: on
line diff
--- a/pylons_app/controllers/admin/settings.py	Sat Sep 11 01:52:16 2010 +0200
+++ b/pylons_app/controllers/admin/settings.py	Sat Sep 11 01:55:46 2010 +0200
@@ -38,6 +38,7 @@
     ApplicationUiSettingsForm
 from pylons_app.model.hg_model import HgModel
 from pylons_app.model.user_model import UserModel
+from pylons_app.lib.celerylib import tasks,run_task
 import formencode
 import logging
 import traceback
@@ -102,6 +103,12 @@
             invalidate_cache('cached_repo_list')
             h.flash(_('Repositories sucessfully rescanned'), category='success')            
         
+        if setting_id == 'whoosh':
+            repo_location = get_hg_ui_settings()['paths_root_path']
+            full_index = request.POST.get('full_index',False)
+            task = run_task(tasks.whoosh_index,True,repo_location,full_index)
+            
+            h.flash(_('Whoosh reindex task scheduled'), category='success')
         if setting_id == 'global':
             
             application_form = ApplicationSettingsForm()()