Show More
@@ -34,14 +34,15 b' def free_cache_keys(*args):' | |||
|
34 | 34 | return |
|
35 | 35 | |
|
36 | 36 | from rhodecode.model.db import Session, CacheKey |
|
37 | log.info('Clearing %s cache keys', len(cache_keys_by_pid)) | |
|
38 | 37 | |
|
39 | 38 | if cache_keys_by_pid: |
|
40 | 39 | try: |
|
41 | 40 | for cache_proc in set(cache_keys_by_pid): |
|
42 | 41 | like_expression = '{}%'.format(cache_proc) |
|
43 | CacheKey.query().filter( | |
|
44 | CacheKey.cache_key.like(like_expression)).delete(synchronize_session='fetch') | |
|
42 | qry = CacheKey.query().filter(CacheKey.cache_key.like(like_expression)) | |
|
43 | count = qry.count() | |
|
44 | log.info('Clearing %s: %s cache keys, total: %s', cache_proc, len(cache_keys_by_pid), count) | |
|
45 | qry.delete(synchronize_session='fetch') | |
|
45 | 46 | cache_keys_by_pid.remove(cache_proc) |
|
46 | 47 | Session().commit() |
|
47 | 48 | except Exception: |
General Comments 0
You need to be logged in to leave comments.
Login now