Changeset - 9378d8640a4b
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 12 years ago 2013-06-05 20:45:05
marcin@python-works.com
Added extra flag to invalidate caches when doing rescan from web
interface
2 files changed with 14 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -112,11 +112,15 @@ class SettingsController(BaseController)
 

	
 
        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 '-'
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -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>
0 comments (0 inline, 0 general)