Pushed the cache increment into the shared code that persists notifications.

Much simpler implementation, inc code removed from tasks and V1/V2 rest clients.
This commit is contained in:
Martyn Inglis
2016-11-22 12:53:20 +00:00
parent 58bbc5a5aa
commit 9e2ba9ee81
9 changed files with 52 additions and 167 deletions

View File

@@ -10,7 +10,7 @@ from app.clients import redis
def check_service_message_limit(key_type, service):
if key_type != KEY_TYPE_TEST:
cache_key = redis.cache_key(service.id)
cache_key = redis.daily_limit_cache_key(service.id)
service_stats = redis_store.get(cache_key)
if not service_stats:
service_stats = services_dao.fetch_todays_total_message_count(service.id)