Skip to content

Commit 9be40ac

Browse files
committed
docs: use temp directory in doctest example
The /var/cache/myapp path requires root permissions which causes doctest failures in CI. Changed to use tempfile.gettempdir() which works in any environment.
1 parent 27d3968 commit 9be40ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/guides/backend-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,14 @@ export CACHEKIT_FILE_DIR_PERMISSIONS=0o700 # Default: 0o700 (owner rwx)
146146
**Configuration via Python**:
147147

148148
```python
149+
import tempfile
149150
from pathlib import Path
150151
from cachekit.backends.file import FileBackend
151152
from cachekit.backends.file.config import FileBackendConfig
152153

153154
# Custom configuration
154155
config = FileBackendConfig(
155-
cache_dir=Path("/var/cache/myapp"),
156+
cache_dir=Path(tempfile.gettempdir()) / "myapp_cache",
156157
max_size_mb=2048,
157158
max_value_mb=200,
158159
max_entry_count=50000,

0 commit comments

Comments
 (0)