mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Merge pull request #2032 from alphagov/increase-redis-ttl
Make Redis hold onto cached API responses longer
This commit is contained in:
@@ -4,7 +4,7 @@ from datetime import timedelta
|
|||||||
from functools import wraps
|
from functools import wraps
|
||||||
from inspect import signature
|
from inspect import signature
|
||||||
|
|
||||||
TTL = int(timedelta(hours=24).total_seconds())
|
TTL = int(timedelta(days=7).total_seconds())
|
||||||
|
|
||||||
|
|
||||||
def _get_argument(argument_name, client_method, args, kwargs):
|
def _get_argument(argument_name, client_method, args, kwargs):
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ def test_client_returns_count_of_service_templates(
|
|||||||
call(
|
call(
|
||||||
'service-{}'.format(SERVICE_ONE_ID),
|
'service-{}'.format(SERVICE_ONE_ID),
|
||||||
'{"data_from": "api"}',
|
'{"data_from": "api"}',
|
||||||
ex=86400
|
ex=604800,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
{'data_from': 'api'},
|
{'data_from': 'api'},
|
||||||
@@ -205,7 +205,7 @@ def test_client_returns_count_of_service_templates(
|
|||||||
call(
|
call(
|
||||||
'template-{}-version-None'.format(FAKE_TEMPLATE_ID),
|
'template-{}-version-None'.format(FAKE_TEMPLATE_ID),
|
||||||
'{"data_from": "api"}',
|
'{"data_from": "api"}',
|
||||||
ex=86400
|
ex=604800,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
{'data_from': 'api'},
|
{'data_from': 'api'},
|
||||||
@@ -235,7 +235,7 @@ def test_client_returns_count_of_service_templates(
|
|||||||
call(
|
call(
|
||||||
'template-{}-version-1'.format(FAKE_TEMPLATE_ID),
|
'template-{}-version-1'.format(FAKE_TEMPLATE_ID),
|
||||||
'{"data_from": "api"}',
|
'{"data_from": "api"}',
|
||||||
ex=86400
|
ex=604800,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
{'data_from': 'api'},
|
{'data_from': 'api'},
|
||||||
@@ -265,7 +265,7 @@ def test_client_returns_count_of_service_templates(
|
|||||||
call(
|
call(
|
||||||
'service-{}-templates'.format(SERVICE_ONE_ID),
|
'service-{}-templates'.format(SERVICE_ONE_ID),
|
||||||
'{"data_from": "api"}',
|
'{"data_from": "api"}',
|
||||||
ex=86400
|
ex=604800,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
{'data_from': 'api'},
|
{'data_from': 'api'},
|
||||||
@@ -295,7 +295,7 @@ def test_client_returns_count_of_service_templates(
|
|||||||
call(
|
call(
|
||||||
'template-{}-versions'.format(FAKE_TEMPLATE_ID),
|
'template-{}-versions'.format(FAKE_TEMPLATE_ID),
|
||||||
'{"data_from": "api"}',
|
'{"data_from": "api"}',
|
||||||
ex=86400
|
ex=604800,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
{'data_from': 'api'},
|
{'data_from': 'api'},
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ def test_client_converts_admin_permissions_to_db_permissions_on_add_to_service(a
|
|||||||
call(
|
call(
|
||||||
'user-{}'.format(user_id),
|
'user-{}'.format(user_id),
|
||||||
'{"data": "from api"}',
|
'{"data": "from api"}',
|
||||||
ex=86400
|
ex=604800
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
'from api',
|
'from api',
|
||||||
|
|||||||
Reference in New Issue
Block a user