Changeset - dd3171263afd
[Not reviewed]
default
0 4 0
Mads Kiilerich (kiilerix) - 5 years ago 2019-10-20 21:55:46
mads@kiilerich.com
Grafted from: c38a7190278f
db: introduce long_term_file beaker cache to store README and RSS cache on disk where it is reusable between processes - not in worker memory
4 files changed with 12 insertions and 4 deletions:
0 comments (0 inline, 0 general) First comment
development.ini
Show inline comments
 
@@ -275,7 +275,7 @@ celery.task_always_eager = false
 
beaker.cache.data_dir = %(here)s/data/cache/data
 
beaker.cache.lock_dir = %(here)s/data/cache/lock
 

	
 
beaker.cache.regions = short_term,long_term,sql_cache_short
 
beaker.cache.regions = short_term,long_term,sql_cache_short,long_term_file
 

	
 
beaker.cache.short_term.type = memory
 
beaker.cache.short_term.expire = 60
 
@@ -289,6 +289,10 @@ beaker.cache.sql_cache_short.type = memo
 
beaker.cache.sql_cache_short.expire = 10
 
beaker.cache.sql_cache_short.key_length = 256
 

	
 
beaker.cache.long_term_file.type = file
 
beaker.cache.long_term_file.expire = 604800
 
beaker.cache.long_term_file.key_length = 256
 

	
 
####################################
 
###       BEAKER SESSION        ####
 
####################################
kallithea/controllers/feed.py
Show inline comments
 
@@ -101,7 +101,7 @@ class FeedController(BaseRepoController)
 
    def _feed(self, repo_name, feeder):
 
        """Produce a simple feed"""
 

	
 
        @cache_region('long_term', '_get_feed_from_cache')
 
        @cache_region('long_term_file', '_get_feed_from_cache')
 
        def _get_feed_from_cache(*_cache_keys):  # parameters are not really used - only as caching key
 
            header = dict(
 
                title=_('%s %s feed') % (c.site_name, repo_name),
kallithea/controllers/summary.py
Show inline comments
 
@@ -66,7 +66,7 @@ class SummaryController(BaseRepoControll
 
        repo_name = db_repo.repo_name
 
        log.debug('Looking for README file')
 

	
 
        @cache_region('long_term', '_get_readme_from_cache')
 
        @cache_region('long_term_file', '_get_readme_from_cache')
 
        def _get_readme_from_cache(*_cache_keys):  # parameters are not really used - only as caching key
 
            readme_data = None
 
            readme_file = None
kallithea/lib/paster_commands/template.ini.mako
Show inline comments
 
@@ -381,7 +381,7 @@ celery.task_always_eager = false
 
beaker.cache.data_dir = %(here)s/data/cache/data
 
beaker.cache.lock_dir = %(here)s/data/cache/lock
 

	
 
beaker.cache.regions = short_term,long_term,sql_cache_short
 
beaker.cache.regions = short_term,long_term,sql_cache_short,long_term_file
 

	
 
beaker.cache.short_term.type = memory
 
beaker.cache.short_term.expire = 60
 
@@ -395,6 +395,10 @@ beaker.cache.sql_cache_short.type = memo
 
beaker.cache.sql_cache_short.expire = 10
 
beaker.cache.sql_cache_short.key_length = 256
 

	
 
beaker.cache.long_term_file.type = file
 
beaker.cache.long_term_file.expire = 604800
 
beaker.cache.long_term_file.key_length = 256
 

	
 
<%text>####################################</%text>
 
<%text>###       BEAKER SESSION        ####</%text>
 
<%text>####################################</%text>
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now