AI-Astrology / backend /storage /transit_cache.py
luoleyuan's picture
Deploy minimal app (runtime only)
5960fdf verified
from __future__ import annotations
from .cache import get_cache
def get_transit_cache(profile_id: str, date_key: str) -> dict | None:
cache = get_cache()
return cache.get_json(f"transit:{profile_id}:{date_key}")
def set_transit_cache(profile_id: str, date_key: str, transit_json: dict, ttl_seconds: int = 7 * 24 * 3600) -> None:
cache = get_cache()
cache.set_json(f"transit:{profile_id}:{date_key}", transit_json, ttl_seconds=ttl_seconds)