Mercurial > kallithea
comparison 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 |
comparison
equal
deleted
inserted
replaced
466:183cee110578 | 467:3fc3ce53659b |
---|---|
36 from pylons_app.model.db import User, UserLog, HgAppSettings, HgAppUi | 36 from pylons_app.model.db import User, UserLog, HgAppSettings, HgAppUi |
37 from pylons_app.model.forms import UserForm, ApplicationSettingsForm, \ | 37 from pylons_app.model.forms import UserForm, ApplicationSettingsForm, \ |
38 ApplicationUiSettingsForm | 38 ApplicationUiSettingsForm |
39 from pylons_app.model.hg_model import HgModel | 39 from pylons_app.model.hg_model import HgModel |
40 from pylons_app.model.user_model import UserModel | 40 from pylons_app.model.user_model import UserModel |
41 from pylons_app.lib.celerylib import tasks,run_task | |
41 import formencode | 42 import formencode |
42 import logging | 43 import logging |
43 import traceback | 44 import traceback |
44 | 45 |
45 log = logging.getLogger(__name__) | 46 log = logging.getLogger(__name__) |
100 initial = HgModel.repo_scan(g.paths[0][0], g.paths[0][1], g.baseui) | 101 initial = HgModel.repo_scan(g.paths[0][0], g.paths[0][1], g.baseui) |
101 repo2db_mapper(initial, rm_obsolete) | 102 repo2db_mapper(initial, rm_obsolete) |
102 invalidate_cache('cached_repo_list') | 103 invalidate_cache('cached_repo_list') |
103 h.flash(_('Repositories sucessfully rescanned'), category='success') | 104 h.flash(_('Repositories sucessfully rescanned'), category='success') |
104 | 105 |
106 if setting_id == 'whoosh': | |
107 repo_location = get_hg_ui_settings()['paths_root_path'] | |
108 full_index = request.POST.get('full_index',False) | |
109 task = run_task(tasks.whoosh_index,True,repo_location,full_index) | |
110 | |
111 h.flash(_('Whoosh reindex task scheduled'), category='success') | |
105 if setting_id == 'global': | 112 if setting_id == 'global': |
106 | 113 |
107 application_form = ApplicationSettingsForm()() | 114 application_form = ApplicationSettingsForm()() |
108 try: | 115 try: |
109 form_result = application_form.to_python(dict(request.POST)) | 116 form_result = application_form.to_python(dict(request.POST)) |