From aaff5564ec9a13863291ec527b84f31d50250f6a Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Tue, 18 Oct 2016 17:44:51 +0200 Subject: [PATCH] Use soft_limit for `__check_routing_quota` #281 --- .../python/cartodb_services/cartodb_services/metrics/quota.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/lib/python/cartodb_services/cartodb_services/metrics/quota.py b/server/lib/python/cartodb_services/cartodb_services/metrics/quota.py index 13aefc7..16c1df7 100644 --- a/server/lib/python/cartodb_services/cartodb_services/metrics/quota.py +++ b/server/lib/python/cartodb_services/cartodb_services/metrics/quota.py @@ -115,8 +115,9 @@ class QuotaChecker: today = date.today() service_type = self._user_service_config.service_type current_used = self._user_service.used_quota(service_type, today) + soft_limit = self._user_service_config.soft_limit - if (user_quota > 0 and current_used <= user_quota): + if soft_limit or (user_quota > 0 and current_used <= user_quota): return True else: return False