Fix bug in check_service_over_daily_limit

I forgot to return service_stats if the cache exists. And fixed the tests to check service_stats value.
This commit is contained in:
Rebecca Law
2021-06-29 12:59:20 +01:00
parent 310e1cb4e2
commit ed788cb0bd
2 changed files with 9 additions and 5 deletions

View File

@@ -74,6 +74,7 @@ def check_service_over_daily_message_limit(key_type, service):
service.id, int(service_stats), service.message_limit)
)
raise TooManyRequestsError(service.message_limit)
return service_stats
def check_rate_limiting(service, api_key):