##// END OF EJS Templates
Added extra flag to invalidate caches when doing rescan from web...
marcink -
r3951:9378d864 beta
parent child Browse files
Show More
@@ -112,11 +112,15 b' class SettingsController(BaseController)'
112
112
113 if setting_id == 'mapping':
113 if setting_id == 'mapping':
114 rm_obsolete = request.POST.get('destroy', False)
114 rm_obsolete = request.POST.get('destroy', False)
115 log.debug('Rescanning directories with destroy=%s' % rm_obsolete)
115 invalidate_cache = request.POST.get('invalidate', False)
116 log.debug('rescanning directories with destroy obsolete=%s'
117 % (rm_obsolete,))
116 initial = ScmModel().repo_scan()
118 initial = ScmModel().repo_scan()
117 log.debug('invalidating all repositories')
119
118 for repo_name in initial.keys():
120 if invalidate_cache:
119 ScmModel().mark_for_invalidation(repo_name)
121 log.debug('invalidating all repositories cache')
122 for repo_name in initial.keys():
123 ScmModel().mark_for_invalidation(repo_name)
120
124
121 added, removed = repo2db_mapper(initial, rm_obsolete)
125 added, removed = repo2db_mapper(initial, rm_obsolete)
122 _repr = lambda l: ', '.join(map(safe_unicode, l)) or '-'
126 _repr = lambda l: ', '.join(map(safe_unicode, l)) or '-'
@@ -40,6 +40,12 b''
40 <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.'))}">
40 <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.'))}">
41 ${_('Destroy old data')}</span> </label>
41 ${_('Destroy old data')}</span> </label>
42 </div>
42 </div>
43 <div class="checkbox">
44 ${h.checkbox('invalidate',True)}
45 <label for="invalidate">
46 <span class="tooltip" title="${h.tooltip(_('Invalidate cache for all repositories during scan'))}">
47 ${_('Invalidate cache for all repositories')}</span> </label>
48 </div>
43 <span class="help-block">${_('Rescan repositories location for new repositories. Also deletes obsolete if `destroy` flag is checked ')}</span>
49 <span class="help-block">${_('Rescan repositories location for new repositories. Also deletes obsolete if `destroy` flag is checked ')}</span>
44 </div>
50 </div>
45 </div>
51 </div>
General Comments 0
You need to be logged in to leave comments. Login now