comparison rhodecode/lib/utils.py @ 3693:6843cabe9925 beta

removed duplicated logic of how we invalidate caches for repos
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 03 Apr 2013 02:35:01 +0200
parents 4c78a0855a17
children 34093903b505
comparison
equal deleted inserted replaced
3692:5f9f4ece4b52 3693:6843cabe9925
352 """ 352 """
353 hgsettings = RhodeCodeSetting.get_app_settings() 353 hgsettings = RhodeCodeSetting.get_app_settings()
354 354
355 for k, v in hgsettings.items(): 355 for k, v in hgsettings.items():
356 config[k] = v 356 config[k] = v
357
358
359 def invalidate_cache(cache_key, *args):
360 """
361 Puts cache invalidation task into db for
362 further global cache invalidation
363 """
364
365 from rhodecode.model.scm import ScmModel
366
367 if cache_key.startswith('get_repo_cached_'):
368 name = cache_key.split('get_repo_cached_')[-1]
369 ScmModel().mark_for_invalidation(name)
370 357
371 358
372 def map_groups(path): 359 def map_groups(path):
373 """ 360 """
374 Given a full path to a repository, create all nested groups that this 361 Given a full path to a repository, create all nested groups that this