Skip to content

Commit

Permalink
feat: adding ability to get all keys matching a specific pattern. Add…
Browse files Browse the repository at this point in the history
…ed functions to construct the service and template keys (#94)

* feat: adding ability to get all keys matching a specific pattern. Added functions to construct the service and template keys

* fix: formatting

* fix: add _cache_key post-fix to be consistent with function naming

* fix: remove unnecessary function
  • Loading branch information
Moro-Code committed Jul 27, 2021
1 parent 623d109 commit 505996b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions notifications_utils/clients/redis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ def near_daily_limit_cache_key(service_id):
return f"nearing-{daily_limit_cache_key(service_id)}"


def template_version_cache_key(template_id, version=None):
return f"template-{template_id}-version-{version}"


def service_cache_key(service_id):
return f"service-{service_id}"


def over_daily_limit_cache_key(service_id):
return f"over-{daily_limit_cache_key(service_id)}"

Expand Down

0 comments on commit 505996b

Please sign in to comment.