Skip to content

Commit

Permalink
Remove system check for ENKETO_REDIS_MAIN_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed Jan 11, 2024
1 parent 1db2ea3 commit 31c5143
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 67 deletions.
21 changes: 0 additions & 21 deletions conftest.py

This file was deleted.

2 changes: 0 additions & 2 deletions kobo/apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from django.apps import AppConfig
from django.core.checks import register, Tags

from kpi.utils.system_check import required_env_vars_check
from kpi.utils.two_database_configuration_checker import \
TwoDatabaseConfigurationChecker

Expand All @@ -19,4 +18,3 @@ def ready(self, *args, **kwargs):


register(TwoDatabaseConfigurationChecker().as_check(), Tags.database)
register(required_env_vars_check, Tags.compatibility)
3 changes: 2 additions & 1 deletion kobo/apps/service_health/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import requests
from django.conf import settings
from django.core.cache import cache
from django.core.cache import cache, caches
from django.http import HttpResponse

from kobo.celery import celery_app
Expand Down Expand Up @@ -75,6 +75,7 @@ def service_health(request):
'Enketo': lambda: requests.get(
settings.ENKETO_INTERNAL_URL, timeout=10
).raise_for_status(),
'Enketo Redis (main)': lambda: caches['enketo_redis_main'].set('a', True, 1),
}

check_results = []
Expand Down
9 changes: 4 additions & 5 deletions kobo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from urllib.parse import quote_plus

import django.conf.locale
import environ
from celery.schedules import crontab
from django.conf.global_settings import LOGIN_URL
from django.urls import reverse_lazy
from django.utils.translation import get_language_info, gettext_lazy as t
from pymongo import MongoClient

import kpi.utils.environ as environ
from kpi.utils.json import LazyJSONSerializable
from kobo.apps.stripe.constants import FREE_TIER_NO_THRESHOLDS, FREE_TIER_EMPTY_DISPLAY
from ..static_lists import EXTRA_LANG_INFO, SECTOR_CHOICE_DEFAULTS
Expand Down Expand Up @@ -1302,7 +1302,9 @@ def dj_stripe_request_callback_method():
CACHES = {
# Set CACHE_URL to override
'default': env.cache_url(default='redis://redis_cache:6380/3'),
'enketo_redis_main': env.lazy_cache_url('ENKETO_REDIS_MAIN_URL')
'enketo_redis_main': env.cache_url(
'ENKETO_REDIS_MAIN_URI', default='redis://change-me.invalid/0'
),
}

# How long to retain cached responses for kpi endpoints
Expand Down Expand Up @@ -1404,6 +1406,3 @@ def dj_stripe_request_callback_method():
'NAME': 'kpi.password_validation.MostRecentPasswordValidator',
},
]

# Keep at the end of file to be sure all required env variables are registered
ENVIRONMENT_VARIABLES_TO_CHECK = env.lazy_env_vars
14 changes: 0 additions & 14 deletions kpi/utils/environ.py

This file was deleted.

24 changes: 0 additions & 24 deletions kpi/utils/system_check.py

This file was deleted.

0 comments on commit 31c5143

Please sign in to comment.