From 99d192ff6da1be520717a2856bd93d6c1fd47a03 Mon Sep 17 00:00:00 2001 From: Douglas Paz Date: Wed, 10 Oct 2018 23:42:03 -0300 Subject: [PATCH 1/2] Create 200 view/endpoint to ping request --- bothub/health/checks.py | 4 ++-- bothub/health/tests.py | 1 - bothub/health/views.py | 4 ++++ bothub/urls.py | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 bothub/health/tests.py diff --git a/bothub/health/checks.py b/bothub/health/checks.py index 2becb5ab..47420712 100644 --- a/bothub/health/checks.py +++ b/bothub/health/checks.py @@ -29,11 +29,11 @@ def check_database_connection(**kwargs): def check_accessible_api(request, **kwargs): import requests - logger.info('requesting {}'.format(CHECK_ACCESSIBLE_API_URL)) if CHECK_ACCESSIBLE_API_URL: + logger.info('requesting {}'.format(CHECK_ACCESSIBLE_API_URL)) response = requests.get(CHECK_ACCESSIBLE_API_URL) else: - url = 'http://{}/api/repositories/'.format( + url = 'http://{}/200/'.format( request.META.get('HTTP_HOST')) logger.info('requesting to {}'.format(url)) response = requests.get(url) diff --git a/bothub/health/tests.py b/bothub/health/tests.py deleted file mode 100644 index e4defabc..00000000 --- a/bothub/health/tests.py +++ /dev/null @@ -1 +0,0 @@ -# from django.test import TestCase diff --git a/bothub/health/views.py b/bothub/health/views.py index 3025944a..3b77dbf4 100644 --- a/bothub/health/views.py +++ b/bothub/health/views.py @@ -32,3 +32,7 @@ def ping(request): content=content, content_type='text/plain', status=status_code) + + +def r200(request): + return HttpResponse() diff --git a/bothub/urls.py b/bothub/urls.py index 929f0c92..ae2682c4 100644 --- a/bothub/urls.py +++ b/bothub/urls.py @@ -5,6 +5,7 @@ from bothub.api.routers import router as bothub_api_routers from bothub.health.views import ping +from bothub.health.views import r200 from bothub.common.views import download_bot_data @@ -14,6 +15,7 @@ path('docs/', include_docs_urls(title='API Documentation')), path('admin/', admin.site.urls), path('ping/', ping, name='ping'), + path('200/', r200, name='200'), path( 'downloadbotdata//', download_bot_data, From ce6089d59b794ae98c9dfb9c251aeea0cb15d3ff Mon Sep 17 00:00:00 2001 From: Douglas Paz Date: Wed, 10 Oct 2018 23:45:02 -0300 Subject: [PATCH 2/2] Bump version to 1.6.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6a9ead42..174ce752 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='bothub-engine', - version='1.16.0', + version='1.16.1', description='Bothub Engine', packages=find_packages(), install_requires=[