Add diskcache logging

This commit is contained in:
MMaker 2025-02-27 11:16:14 -05:00
parent 6e95c1dd52
commit 246de3e29d
Signed by: mmaker
GPG Key ID: CCE79B8FEDA40FB2

7
app.py
View File

@ -34,7 +34,12 @@ MAX_CONCURRENT_DOWNLOADS = 3
CACHE_EXPIRATION_SECONDS = 3600 # 1 hour
CACHE_SIZE_LIMIT = 100 * 1024 * 1024 # 100 MB
cache = None if os.environ.get('NICONICOGAY_DISABLE_CACHE', '') != '' else Cache("disk_cache", size_limit=CACHE_SIZE_LIMIT)
cache = None
if os.environ.get('NICONICOGAY_DISABLE_CACHE', '') != '1':
Cache("disk_cache", size_limit=CACHE_SIZE_LIMIT)
logger.info("Using disk cache")
else:
logger.info("Disk cache disabled")
user_session = None
cookie_jar = http.cookiejar.MozillaCookieJar('cookies.txt')