feat(config): Adding a configurable way of setting the cache directory for constrained environments

This commit is contained in:
Mahesh
2024-11-12 14:52:51 -07:00
parent 8c22396d8b
commit 00026b5f8b
10 changed files with 14 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ import sys
# Create the .crawl4ai folder in the user's home directory if it doesn't exist
# If the folder already exists, remove the cache folder
crawl4ai_folder = Path.home() / ".crawl4ai"
crawl4ai_folder = os.getenv("CRAWL4_AI_BASE_DIRECTORY", Path.home()) / ".crawl4ai"
cache_folder = crawl4ai_folder / "cache"
if cache_folder.exists():