Merge "Don't register backends on import"
This commit is contained in:
commit
46f32c0422
@ -14,18 +14,10 @@
|
||||
|
||||
"""Caching Layer Implementation.
|
||||
|
||||
When this library is imported, it registers the following backends in
|
||||
:mod:`dogpile.cache`:
|
||||
|
||||
* ``oslo_cache.noop`` - :class:`oslo_cache.backends.noop.NoopCacheBackend`
|
||||
* ``oslo_cache.mongo`` - :class:`oslo_cache.backends.mongo.MongoCacheBackend`
|
||||
* ``oslo_cache.memcache_pool`` -
|
||||
:class:`oslo_cache.backends.memcache_pool.PooledMemcachedBackend`
|
||||
* ``oslo_cache.dict`` -
|
||||
:class:`oslo_cache.backends.dictionary.DictCacheBackend`
|
||||
|
||||
To use this library:
|
||||
|
||||
You must call :func:`configure`.
|
||||
|
||||
Inside your application code, decorate the methods that you want the results
|
||||
to be cached with a memoization decorator created with
|
||||
:func:`get_memoization_decorator`. This function takes a group name from the
|
||||
@ -66,9 +58,6 @@ _BACKENDS = [
|
||||
('oslo_cache.dict', 'oslo_cache.backends.dictionary', 'DictCacheBackend'),
|
||||
]
|
||||
|
||||
for backend in _BACKENDS:
|
||||
dogpile.cache.register_backend(*backend)
|
||||
|
||||
|
||||
class _DebugProxy(proxy.ProxyBackend):
|
||||
"""Extra Logging ProxyBackend."""
|
||||
@ -367,8 +356,21 @@ def configure(conf):
|
||||
|
||||
This must be called before conf().
|
||||
|
||||
The following backends are registered in :mod:`dogpile.cache`:
|
||||
|
||||
* ``oslo_cache.noop`` - :class:`oslo_cache.backends.noop.NoopCacheBackend`
|
||||
* ``oslo_cache.mongo`` -
|
||||
:class:`oslo_cache.backends.mongo.MongoCacheBackend`
|
||||
* ``oslo_cache.memcache_pool`` -
|
||||
:class:`oslo_cache.backends.memcache_pool.PooledMemcachedBackend`
|
||||
* ``oslo_cache.dict`` -
|
||||
:class:`oslo_cache.backends.dictionary.DictCacheBackend`
|
||||
|
||||
:param conf: The configuration object.
|
||||
:type conf: oslo_config.cfg.ConfigOpts
|
||||
|
||||
"""
|
||||
_opts.configure(conf)
|
||||
|
||||
for backend in _BACKENDS:
|
||||
dogpile.cache.register_backend(*backend)
|
||||
|
@ -10,9 +10,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_cache import _opts
|
||||
from oslo_cache import core
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
||||
_opts.configure(cfg.CONF)
|
||||
core.configure(cfg.CONF)
|
||||
|
Loading…
x
Reference in New Issue
Block a user