Added CACHE_DIR env variable, graceful handling when APScheduler is not installed

This commit is contained in:
mmonkey
2021-09-19 22:45:19 -05:00
parent d648785471
commit 8bee2b9552
5 changed files with 40 additions and 16 deletions
+4 -1
View File
@@ -40,7 +40,10 @@ else:
STATIC_DIR = os.path.join(BASE_DIR, 'cps', 'static')
TEMPLATES_DIR = os.path.join(BASE_DIR, 'cps', 'templates')
TRANSLATIONS_DIR = os.path.join(BASE_DIR, 'cps', 'translations')
CACHE_DIR = os.path.join(BASE_DIR, 'cps', 'cache')
# Cache dir - use CACHE_DIR environment variable, otherwise use the default directory: cps/cache
DEFAULT_CACHE_DIR = os.path.join(BASE_DIR, 'cps', 'cache')
CACHE_DIR = os.environ.get("CACHE_DIR", DEFAULT_CACHE_DIR)
if HOME_CONFIG:
home_dir = os.path.join(os.path.expanduser("~"),".calibre-web")