mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 16:01:15 -05:00
- Uses Redis cache to check for current count - If not present then sets the value based on the database state - Any Redis errors are swallowed. Cache failures should NOT fail the request.
6 lines
154 B
Python
6 lines
154 B
Python
from datetime import datetime
|
|
|
|
|
|
def cache_key(service_id):
|
|
return "{}-{}-{}".format(str(service_id), datetime.utcnow().strftime("%Y-%m-%d"), "count")
|