Merge pull request #13675 from edx/andy/move-service-status
Move service_status from common into openedx
This commit is contained in:
@@ -809,7 +809,7 @@ INSTALLED_APPS = (
|
||||
'config_models',
|
||||
|
||||
# Monitor the status of services
|
||||
'service_status',
|
||||
'openedx.core.djangoapps.service_status',
|
||||
|
||||
# Testing
|
||||
'django_nose',
|
||||
|
||||
@@ -148,7 +148,7 @@ if settings.FEATURES.get('ENABLE_EXPORT_GIT'):
|
||||
if settings.FEATURES.get('ENABLE_SERVICE_STATUS'):
|
||||
urlpatterns += patterns(
|
||||
'',
|
||||
url(r'^status/', include('service_status.urls')),
|
||||
url(r'^status/', include('openedx.core.djangoapps.service_status.urls')),
|
||||
)
|
||||
|
||||
if settings.FEATURES.get('AUTH_USE_CAS'):
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
"""
|
||||
Django URLs for service status app
|
||||
"""
|
||||
|
||||
from django.conf.urls import patterns, url
|
||||
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
url(r'^$', 'service_status.views.index', name='status.service.index'),
|
||||
url(r'^celery/$', 'service_status.views.celery_status',
|
||||
name='status.service.celery.status'),
|
||||
url(r'^celery/ping/$', 'service_status.views.celery_ping',
|
||||
name='status.service.celery.ping'),
|
||||
)
|
||||
@@ -1876,7 +1876,7 @@ INSTALLED_APPS = (
|
||||
'config_models',
|
||||
|
||||
# Monitor the status of services
|
||||
'service_status',
|
||||
'openedx.core.djangoapps.service_status',
|
||||
|
||||
# Display status message to students
|
||||
'status',
|
||||
|
||||
@@ -891,7 +891,7 @@ if settings.FEATURES.get('ENABLE_SQL_TRACKING_LOGS'):
|
||||
|
||||
if settings.FEATURES.get('ENABLE_SERVICE_STATUS'):
|
||||
urlpatterns += (
|
||||
url(r'^status/', include('service_status.urls')),
|
||||
url(r'^status/', include('openedx.core.djangoapps.service_status.urls')),
|
||||
)
|
||||
|
||||
if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
|
||||
|
||||
15
openedx/core/djangoapps/service_status/urls.py
Normal file
15
openedx/core/djangoapps/service_status/urls.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
Django URLs for service status app
|
||||
"""
|
||||
|
||||
from django.conf.urls import patterns, url
|
||||
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
url(r'^$', 'openedx.core.djangoapps.service_status.views.index', name='status.service.index'),
|
||||
url(r'^celery/$', 'openedx.core.djangoapps.service_status.views.celery_status',
|
||||
name='status.service.celery.status'),
|
||||
url(r'^celery/ping/$', 'openedx.core.djangoapps.service_status.views.celery_ping',
|
||||
name='status.service.celery.ping'),
|
||||
)
|
||||
@@ -9,10 +9,11 @@ from django.http import HttpResponse
|
||||
|
||||
from dogapi import dog_stats_api
|
||||
|
||||
from service_status import tasks
|
||||
from djcelery import celery
|
||||
from celery.exceptions import TimeoutError
|
||||
|
||||
from openedx.core.djangoapps.service_status.tasks import delayed_ping
|
||||
|
||||
|
||||
def index(_):
|
||||
"""
|
||||
@@ -37,7 +38,7 @@ def celery_ping(_):
|
||||
A Simple view that checks if Celery can process a simple task
|
||||
"""
|
||||
start = time.time()
|
||||
result = tasks.delayed_ping.apply_async(('ping', 0.1))
|
||||
result = delayed_ping.apply_async(('ping', 0.1))
|
||||
task_id = result.id
|
||||
|
||||
# Wait until we get the result
|
||||
Reference in New Issue
Block a user