"""
Process-local minimum refresh interval for Simpro REST calls that use in-memory caches.

All cached Simpro consumers should use this TTL so we never hit Simpro more than once
per (resource key) within this window, regardless of dashboard refresh or polling.
Override with env SIMPRO_API_CACHE_TTL_SECONDS (integer seconds) if needed.
"""
import os

_SIMPRO_CACHE_TTL_DEFAULT = 10 * 60  # 10 minutes

SIMPRO_API_CACHE_TTL_SECONDS = int(
    os.getenv("SIMPRO_API_CACHE_TTL_SECONDS", str(_SIMPRO_CACHE_TTL_DEFAULT))
)
