Changeset - 569feabd3c9d
[Not reviewed]
default
0 4 0
Thomas De Schampheleire - 9 years ago 2016-08-21 13:43:06
thomas.de.schampheleire@gmail.com
utils: rename add_cache to setup_cache_regions

Rename method 'add_cache' to something that better describes what it
actually does.
4 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/celerylib/tasks.py
Show inline comments
 
@@ -44,7 +44,7 @@ from kallithea.lib.celerylib import run_
 
    str2bool, __get_lockkey, LockHeld, DaemonLock, get_session
 
from kallithea.lib.helpers import person
 
from kallithea.lib.rcmail.smtp_mailer import SmtpMailer
 
from kallithea.lib.utils import add_cache, action_logger
 
from kallithea.lib.utils import setup_cache_regions, action_logger
 
from kallithea.lib.vcs.utils import author_email
 
from kallithea.lib.compat import json, OrderedDict
 
from kallithea.lib.hooks import log_create_repository
 
@@ -52,7 +52,7 @@ from kallithea.lib.hooks import log_crea
 
from kallithea.model.db import Statistics, Repository, User
 

	
 

	
 
add_cache(config)  # pragma: no cover
 
setup_cache_regions(config)  # pragma: no cover
 

	
 
__all__ = ['whoosh_index', 'get_commits_stats', 'send_email']
 

	
kallithea/lib/paster_commands/common.py
Show inline comments
 
@@ -31,7 +31,7 @@ import logging
 
import paste
 
from paste.script.command import Command, BadCommand
 

	
 
from kallithea.lib.utils import add_cache
 
from kallithea.lib.utils import setup_cache_regions
 

	
 

	
 
def ask_ok(prompt, retries=4, complaint='Yes or no please!'):
 
@@ -108,6 +108,6 @@ class BasePasterCommand(Command):
 
        from pylons import config
 
        from kallithea.model import init_model
 
        from kallithea.lib.utils2 import engine_from_config
 
        add_cache(config)
 
        setup_cache_regions(config)
 
        engine = engine_from_config(config, 'sqlalchemy.db1.')
 
        init_model(engine)
kallithea/lib/utils.py
Show inline comments
 
@@ -747,7 +747,7 @@ def jsonify(func, *args, **kwargs):
 
#===============================================================================
 

	
 
# set cache regions for beaker so celery can utilise it
 
def add_cache(settings):
 
def setup_cache_regions(settings):
 
    cache_settings = {'regions': None}
 
    for key in settings.keys():
 
        for prefix in ['beaker.cache.', 'cache.']:
kallithea/tests/scripts/manual_test_concurrency.py
Show inline comments
 
@@ -38,7 +38,7 @@ from subprocess import Popen, PIPE
 
from paste.deploy import appconfig
 
from sqlalchemy import engine_from_config
 

	
 
from kallithea.lib.utils import add_cache
 
from kallithea.lib.utils import setup_cache_regions
 
from kallithea.model import init_model
 
from kallithea.model import meta
 
from kallithea.model.db import User, Repository, Ui
 
@@ -51,7 +51,7 @@ rel_path = dirname(dirname(dirname(dirna
 
conf = appconfig('config:development.ini', relative_to=rel_path)
 
load_environment(conf.global_conf, conf.local_conf)
 

	
 
add_cache(conf)
 
setup_cache_regions(conf)
 

	
 
USER = TEST_USER_ADMIN_LOGIN
 
PASS = TEST_USER_ADMIN_PASS
0 comments (0 inline, 0 general)