##// END OF EJS Templates
cache-key: make cleanup safe so we don't cause any errors on exit in case it fails..
ergo -
r3893:c865048b default
parent child Browse files
Show More
@@ -30,6 +30,11 b' cache_keys_by_pid = []'
30 def free_cache_keys():
30 def free_cache_keys():
31 from rhodecode.model.db import Session, CacheKey
31 from rhodecode.model.db import Session, CacheKey
32 log.info('Clearing %s cache keys', len(cache_keys_by_pid))
32 log.info('Clearing %s cache keys', len(cache_keys_by_pid))
33 for cache_key in cache_keys_by_pid:
33
34 CacheKey.query().filter(CacheKey.cache_key == cache_key).delete()
34 if cache_keys_by_pid:
35 Session().commit()
35 try:
36 for cache_key in cache_keys_by_pid:
37 CacheKey.query().filter(CacheKey.cache_key == cache_key).delete()
38 Session().commit()
39 except Exception:
40 log.warn('Failed to clear keys, exiting gracefully')
General Comments 0
You need to be logged in to leave comments. Login now