Skip to content

Commit

Permalink
default for filesystem_cache_folder is filesystem_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiering committed Dec 10, 2024
1 parent b3d0c16 commit 2bb2d63
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion radicale/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
5 changes: 4 additions & 1 deletion radicale/storage/multifilesystem/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit 2bb2d63

Please sign in to comment.