소스 검색

Add env var for cache file

catboxanon 2 년 전
부모
커밋
386202895f
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      modules/cache.py

+ 2 - 1
modules/cache.py

@@ -1,11 +1,12 @@
 import json
+import os
 import os.path
 import threading
 import time
 
 from modules.paths import data_path, script_path
 
-cache_filename = os.path.join(data_path, "cache.json")
+cache_filename = os.environ.get('SD_WEBUI_CACHE_FILE', os.path.join(data_path, "cache.json"))
 cache_data = None
 cache_lock = threading.Lock()