"""Centralized runtime caches."""

from __future__ import annotations

from cachetools import TTLCache


settings_cache: TTLCache = TTLCache(maxsize=500, ttl=10)
locks_cache: TTLCache = TTLCache(maxsize=500, ttl=10)
privileged_cache: TTLCache = TTLCache(maxsize=2000, ttl=30)
botadmin_cache: TTLCache = TTLCache(maxsize=200, ttl=30)


def invalidate_chat(chat_id: int) -> None:
    settings_cache.pop(chat_id, None)
    locks_cache.pop(chat_id, None)
    botadmin_cache.pop(chat_id, None)
