diff pylons_app/lib/utils.py @ 140:b5e59e2b5cfe

moved cache invalidating to utils, as seperate function. Implemented invalidating in
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 09 May 2010 15:06:00 +0200
parents 36102488d634
children 52bbeb1e813f
line wrap: on
line diff
--- a/pylons_app/lib/utils.py	Sun May 09 14:53:52 2010 +0200
+++ b/pylons_app/lib/utils.py	Sun May 09 15:06:00 2010 +0200
@@ -90,6 +90,14 @@
     
     return baseui
 
+def invalidate_cache(name):
+    from beaker.cache import region_invalidate
+    if name == 'repo_list_2':
+        log.info('INVALIDATING CACHE FOR %s', name)
+        from pylons_app.lib.base import _get_repos
+        #clear our cached list for refresh with new repo
+        region_invalidate(_get_repos, None, 'repo_list_2')
+
 from vcs.backends.base import BaseChangeset
 from vcs.utils.lazy import LazyProperty
 class EmptyChangeset(BaseChangeset):