Mercurial > kallithea
changeset 3951:9378d8640a4b beta
Added extra flag to invalidate caches when doing rescan from web
interface
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 05 Jun 2013 20:45:05 +0200 |
parents | 1226fdf24f8a |
children | ebde99f10d77 |
files | rhodecode/controllers/admin/settings.py rhodecode/templates/admin/settings/settings.html |
diffstat | 2 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/controllers/admin/settings.py Wed Jun 05 19:55:35 2013 +0200 +++ b/rhodecode/controllers/admin/settings.py Wed Jun 05 20:45:05 2013 +0200 @@ -112,11 +112,15 @@ if setting_id == 'mapping': rm_obsolete = request.POST.get('destroy', False) - log.debug('Rescanning directories with destroy=%s' % rm_obsolete) + invalidate_cache = request.POST.get('invalidate', False) + log.debug('rescanning directories with destroy obsolete=%s' + % (rm_obsolete,)) initial = ScmModel().repo_scan() - log.debug('invalidating all repositories') - for repo_name in initial.keys(): - ScmModel().mark_for_invalidation(repo_name) + + if invalidate_cache: + log.debug('invalidating all repositories cache') + for repo_name in initial.keys(): + ScmModel().mark_for_invalidation(repo_name) added, removed = repo2db_mapper(initial, rm_obsolete) _repr = lambda l: ', '.join(map(safe_unicode, l)) or '-'
--- a/rhodecode/templates/admin/settings/settings.html Wed Jun 05 19:55:35 2013 +0200 +++ b/rhodecode/templates/admin/settings/settings.html Wed Jun 05 20:45:05 2013 +0200 @@ -40,6 +40,12 @@ <span class="tooltip" title="${h.tooltip(_('In case a repository was deleted from filesystem and there are leftovers in the database check this option to scan obsolete data in database and remove it.'))}"> ${_('Destroy old data')}</span> </label> </div> + <div class="checkbox"> + ${h.checkbox('invalidate',True)} + <label for="invalidate"> + <span class="tooltip" title="${h.tooltip(_('Invalidate cache for all repositories during scan'))}"> + ${_('Invalidate cache for all repositories')}</span> </label> + </div> <span class="help-block">${_('Rescan repositories location for new repositories. Also deletes obsolete if `destroy` flag is checked ')}</span> </div> </div>