Files
notifications-api/notifications_utils/clients/redis/__init__.py
T

14 lines
360 B
Python
Raw Normal View History

2024-05-23 13:59:51 -07:00
from app.utils import utc_now
2024-05-16 10:17:45 -04:00
from .request_cache import RequestCache # noqa: F401 (unused import)
def total_limit_cache_key(service_id):
return "{}-{}-{}".format(
2024-05-23 13:59:51 -07:00
str(service_id), utc_now().strftime("%Y-%m-%d"), "total-count"
2024-05-16 10:17:45 -04:00
)
def rate_limit_cache_key(service_id, api_key_type):
return "{}-{}".format(str(service_id), api_key_type)