# HG changeset patch # User Thomas De Schampheleire # Date 1471779786 -7200 # Node ID 569feabd3c9dc276cede5bc3edc0b195cc452c47 # Parent 0afdd2802a0a36d90c47e1405e757d18c35d75de utils: rename add_cache to setup_cache_regions Rename method 'add_cache' to something that better describes what it actually does. diff -r 0afdd2802a0a -r 569feabd3c9d kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py Wed Aug 17 21:40:38 2016 +0200 +++ b/kallithea/lib/celerylib/tasks.py Sun Aug 21 13:43:06 2016 +0200 @@ -44,7 +44,7 @@ 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.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'] diff -r 0afdd2802a0a -r 569feabd3c9d kallithea/lib/paster_commands/common.py --- a/kallithea/lib/paster_commands/common.py Wed Aug 17 21:40:38 2016 +0200 +++ b/kallithea/lib/paster_commands/common.py Sun Aug 21 13:43:06 2016 +0200 @@ -31,7 +31,7 @@ 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 @@ 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) diff -r 0afdd2802a0a -r 569feabd3c9d kallithea/lib/utils.py --- a/kallithea/lib/utils.py Wed Aug 17 21:40:38 2016 +0200 +++ b/kallithea/lib/utils.py Sun Aug 21 13:43:06 2016 +0200 @@ -747,7 +747,7 @@ #=============================================================================== # 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.']: diff -r 0afdd2802a0a -r 569feabd3c9d kallithea/tests/scripts/manual_test_concurrency.py --- a/kallithea/tests/scripts/manual_test_concurrency.py Wed Aug 17 21:40:38 2016 +0200 +++ b/kallithea/tests/scripts/manual_test_concurrency.py Sun Aug 21 13:43:06 2016 +0200 @@ -38,7 +38,7 @@ 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 @@ 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