mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-29 17:08:31 -04:00
remove redis debug config var
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from datetime import datetime
|
||||
|
||||
from flask import current_app
|
||||
from notifications_utils.clients.redis import daily_limit_cache_key
|
||||
|
||||
from app.extensions import redis_client
|
||||
@@ -139,7 +138,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
# @cache.delete('service-{service_id}-templates')
|
||||
# @cache.delete_by_pattern('service-{service_id}-template-*')
|
||||
def archive_service(self, service_id, cached_service_user_ids):
|
||||
if cached_service_user_ids and current_app.config['NOTIFY_ADMIN_API_CACHE_ENABLED']:
|
||||
if cached_service_user_ids:
|
||||
redis_client.delete(*map('user-{}'.format, cached_service_user_ids))
|
||||
return self.post('/service/{}/archive'.format(service_id), data=None)
|
||||
|
||||
@@ -596,7 +595,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
broadcast channel is one of "operator", "test", "severe", "government"
|
||||
provider_restriction is one of "all", "three", "o2", "vodafone", "ee"
|
||||
"""
|
||||
if cached_service_user_ids and current_app.config['NOTIFY_ADMIN_API_CACHE_ENABLED']:
|
||||
if cached_service_user_ids:
|
||||
redis_client.delete(*map('user-{}'.format, cached_service_user_ids))
|
||||
|
||||
data = {
|
||||
@@ -610,10 +609,8 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
def get_notification_count(self, service_id):
|
||||
# if cache is not set, or not enabled, return 0
|
||||
|
||||
if current_app.config['NOTIFY_ADMIN_API_CACHE_ENABLED']:
|
||||
count = redis_client.get(daily_limit_cache_key(service_id)) or 0
|
||||
else:
|
||||
count = 0
|
||||
count = redis_client.get(daily_limit_cache_key(service_id)) or 0
|
||||
|
||||
return int(count)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user