mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Reformatted code
This commit is contained in:
@@ -14,14 +14,8 @@ def check_service_over_api_rate_limit(service, api_key):
|
|||||||
cache_key = redis.rate_limit_cache_key(service.id, api_key.key_type)
|
cache_key = redis.rate_limit_cache_key(service.id, api_key.key_type)
|
||||||
rate_limit = current_app.config['API_KEY_LIMITS'][api_key.key_type]['limit']
|
rate_limit = current_app.config['API_KEY_LIMITS'][api_key.key_type]['limit']
|
||||||
interval = current_app.config['API_KEY_LIMITS'][api_key.key_type]['interval']
|
interval = current_app.config['API_KEY_LIMITS'][api_key.key_type]['interval']
|
||||||
if redis_store.exceeded_rate_limit(
|
if redis_store.exceeded_rate_limit(cache_key, rate_limit, interval):
|
||||||
cache_key,
|
raise RateLimitError(interval, api_key.key_type)
|
||||||
rate_limit,
|
|
||||||
interval):
|
|
||||||
raise RateLimitError(
|
|
||||||
rate_limit,
|
|
||||||
interval,
|
|
||||||
api_key.key_type)
|
|
||||||
|
|
||||||
|
|
||||||
def check_service_over_daily_message_limit(key_type, service):
|
def check_service_over_daily_message_limit(key_type, service):
|
||||||
|
|||||||
Reference in New Issue
Block a user