disable cache until we can fix on cloud deployment

This commit is contained in:
James Moffet
2022-07-26 11:17:43 -07:00
parent e6b36becf1
commit 4c25a81004
11 changed files with 88 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
from app.extensions import redis_client
from app.notify_client import NotifyAdminAPIClient, _attach_current_user, cache
from flask import current_app
class JobApiClient(NotifyAdminAPIClient):
@@ -100,11 +101,12 @@ class JobApiClient(NotifyAdminAPIClient):
data = _attach_current_user(data)
job = self.post(url='/service/{}/job'.format(service_id), data=data)
redis_client.set(
'has_jobs-{}'.format(service_id),
b'true',
ex=int(cache.DEFAULT_TTL),
)
if current_app.config['NOTIFY_ADMIN_API_CACHE_ENABLED']:
redis_client.set(
'has_jobs-{}'.format(service_id),
b'true',
ex=int(cache.DEFAULT_TTL),
)
return job