mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Improve: avoid automatically invalid cache on upgrade in case no change on cache structure
This commit is contained in:
parent
778f56cc4d
commit
3983b5c887
2 changed files with 7 additions and 4 deletions
|
@ -9,6 +9,7 @@
|
|||
* Add: option [storage] use_cache_subfolder_for_synctoken for storing 'sync-token' cache outside collection-root
|
||||
* Add: option [storage] folder_umask for configuration of umask (overwrite system-default)
|
||||
* Fix: also remove 'item' from cache on delete
|
||||
* Improve: avoid automatically invalid cache on upgrade in case no change on cache structure
|
||||
|
||||
## 3.3.1
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue