Skip to content

Commit

Permalink
remove seeded_at byte
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbahrai committed Feb 14, 2025
1 parent bcb372c commit 4b98d8f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions notifications_utils/clients/redis/annual_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@ def get_all_notification_counts(self, service_id: str):
Retrieves all daily notification metrics for a service.
"""
if self._redis_client.redis_store.exists(annual_limit_notifications_v2_key(service_id)):
all_keys = self._redis_client.redis_store.hkeys(annual_limit_notifications_v2_key(service_id))
all_keys = self._redis_client.get_all_from_hash(annual_limit_notifications_v2_key(service_id))
# remove the seeded_at key from the list of keys
all_keys.remove(SEEDED_AT) if SEEDED_AT in all_keys else None
seeded_at_byte = bytes(SEEDED_AT, "utf-8")
if seeded_at_byte in all_keys:
del all_keys[seeded_at_byte]
return prepare_byte_dict(
self._redis_client.get_all_from_hash(annual_limit_notifications_v2_key(service_id)),
all_keys,
int,
NOTIFICATION_FIELDS_V2,
)
Expand Down

0 comments on commit 4b98d8f

Please sign in to comment.