Improve: avoid automatically invalid cache on upgrade in case no change on cache structure
This commit is contained in:
@@ -32,20 +32,22 @@ from typing import (Callable, ContextManager, Iterable, Iterator, Mapping,
|
||||
import vobject
|
||||
|
||||
from radicale import config
|
||||
from radicale.log import logger
|
||||
from radicale import item as radicale_item
|
||||
from radicale import types, utils
|
||||
from radicale.item import filter as radicale_filter
|
||||
|
||||
INTERNAL_TYPES: Sequence[str] = ("multifilesystem", "multifilesystem_nolock",)
|
||||
|
||||
CACHE_DEPS: Sequence[str] = ("radicale", "vobject")
|
||||
CACHE_VERSION: bytes = "".join(
|
||||
"%s=%s;" % (pkg, utils.package_version(pkg))
|
||||
for pkg in CACHE_DEPS).encode()
|
||||
# NOTE: change only if cache structure is modified to avoid cache invalidation on update
|
||||
CACHE_VERSION_RADICALE = "3.3.1"
|
||||
|
||||
CACHE_VERSION: bytes = ("%s=%s;%s=%s;" % ("radicale", CACHE_VERSION_RADICALE, "vobject", utils.package_version("vobject"))).encode()
|
||||
|
||||
|
||||
def load(configuration: "config.Configuration") -> "BaseStorage":
|
||||
"""Load the storage module chosen in configuration."""
|
||||
logger.debug("storage cache version: %r", str(CACHE_VERSION))
|
||||
return utils.load_plugin(INTERNAL_TYPES, "storage", "Storage", BaseStorage,
|
||||
configuration)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user