add translation cache and queue

This commit is contained in:
2025-05-29 13:53:25 +03:00
parent bcee61a817
commit 5b76a0dcbd
8 changed files with 307 additions and 24 deletions

16
check_cache_size.py Normal file
View File

@@ -0,0 +1,16 @@
import json
CACHE_FILE = "product_translation_cache.json"
def check_cache_size():
try:
with open(CACHE_FILE, "r", encoding="utf-8") as f:
cache = json.load(f)
print(f"🔎 В кеші збережено {len(cache)} перекладів.")
except FileNotFoundError:
print("❌ Кеш-файл не знайдено.")
except Exception as e:
print(f"⚠️ Помилка читання кешу: {e}")
if __name__ == "__main__":
check_cache_size()