diff --git a/kallithea/lib/celerylib/tasks.py b/kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py +++ b/kallithea/lib/celerylib/tasks.py @@ -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'] diff --git a/kallithea/lib/paster_commands/common.py b/kallithea/lib/paster_commands/common.py --- a/kallithea/lib/paster_commands/common.py +++ b/kallithea/lib/paster_commands/common.py @@ -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) diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -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.']: diff --git a/kallithea/tests/scripts/manual_test_concurrency.py b/kallithea/tests/scripts/manual_test_concurrency.py --- a/kallithea/tests/scripts/manual_test_concurrency.py +++ b/kallithea/tests/scripts/manual_test_concurrency.py @@ -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