diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index ac5f7c5d..283dbb63 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1009,7 +1009,7 @@ Default: `/var/lib/radicale/collections` Folder for storing cache of local collections, created if not present -Default_ `/var/lib/radicale/collections` +Default: (filesystem_folder) Note: only used in case of use_cache_subfolder_* options are active diff --git a/config b/config index 0d62912d..ea56b606 100644 --- a/config +++ b/config @@ -141,7 +141,7 @@ # Folder for storing cache of local collections, created if not present # Note: only used in case of use_cache_subfolder_* options are active # Note: can be used on multi-instance setup to cache files on local node (see below) -#filesystem_cache_folder = /var/lib/radicale/collections +#filesystem_cache_folder = (filesystem_folder) # Use subfolder 'collection-cache' for 'item' cache file structure instead of inside collection folder # Note: can be used on multi-instance setup to cache 'item' on local node diff --git a/radicale/config.py b/radicale/config.py index af4eec74..d2af2ece 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -280,7 +280,7 @@ def json_str(value: Any) -> dict: "help": "path where collections are stored", "type": filepath}), ("filesystem_cache_folder", { - "value": "/var/lib/radicale/collections", + "value": "", "help": "path where cache of collections is stored in case of use_cache_subfolder_* options are active", "type": filepath}), ("use_cache_subfolder_for_item", { diff --git a/radicale/storage/multifilesystem/base.py b/radicale/storage/multifilesystem/base.py index a8549436..cb2ea03c 100644 --- a/radicale/storage/multifilesystem/base.py +++ b/radicale/storage/multifilesystem/base.py @@ -98,7 +98,10 @@ def _get_collection_root_folder(self) -> str: return os.path.join(self._filesystem_folder, "collection-root") def _get_collection_cache_folder(self) -> str: - return os.path.join(self._filesystem_cache_folder, "collection-cache") + if self._filesystem_cache_folder: + return os.path.join(self._filesystem_cache_folder, "collection-cache") + else: + return os.path.join(self._filesystem_folder, "collection-cache") def _get_collection_cache_subfolder(self, path, folder, subfolder) -> str: if (self._use_cache_subfolder_for_item is True) and (subfolder == "item"):