Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
c703834e
Commit
c703834e
authored
Oct 06, 2016
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move heartbeat from common to openedx/core
parent
256223d0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
6 deletions
+12
-6
cms/urls.py
+1
-1
lms/urls.py
+1
-1
openedx/core/djangoapps/heartbeat/__init__.py
+0
-0
openedx/core/djangoapps/heartbeat/tests/__init__.py
+0
-0
openedx/core/djangoapps/heartbeat/tests/test_heartbeat.py
+2
-2
openedx/core/djangoapps/heartbeat/urls.py
+4
-1
openedx/core/djangoapps/heartbeat/views.py
+4
-1
No files found.
cms/urls.py
View file @
c703834e
...
...
@@ -44,7 +44,7 @@ urlpatterns = patterns(
url
(
r'^event$'
,
'contentstore.views.event'
,
name
=
'event'
),
url
(
r'^xmodule/'
,
include
(
'pipeline_js.urls'
)),
url
(
r'^heartbeat$'
,
include
(
'heartbeat.urls'
)),
url
(
r'^heartbeat$'
,
include
(
'
openedx.core.djangoapps.
heartbeat.urls'
)),
url
(
r'^user_api/'
,
include
(
'openedx.core.djangoapps.user_api.legacy_urls'
)),
...
...
lms/urls.py
View file @
c703834e
...
...
@@ -63,7 +63,7 @@ urlpatterns = (
url
(
r'^password_reset_done/$'
,
'django.contrib.auth.views.password_reset_done'
,
name
=
'password_reset_done'
),
url
(
r'^heartbeat$'
,
include
(
'heartbeat.urls'
)),
url
(
r'^heartbeat$'
,
include
(
'
openedx.core.djangoapps.
heartbeat.urls'
)),
# Note: these are older versions of the User API that will eventually be
# subsumed by api/user listed below.
...
...
common
/djangoapps/heartbeat/__init__.py
→
openedx/core
/djangoapps/heartbeat/__init__.py
View file @
c703834e
File moved
common
/djangoapps/heartbeat/tests/__init__.py
→
openedx/core
/djangoapps/heartbeat/tests/__init__.py
View file @
c703834e
File moved
common
/djangoapps/heartbeat/tests/test_heartbeat.py
→
openedx/core
/djangoapps/heartbeat/tests/test_heartbeat.py
View file @
c703834e
...
...
@@ -27,7 +27,7 @@ class HeartbeatTestCase(ModuleStoreTestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_sql_fail
(
self
):
with
patch
(
'heartbeat.views.connection'
)
as
mock_connection
:
with
patch
(
'
openedx.core.djangoapps.
heartbeat.views.connection'
)
as
mock_connection
:
mock_connection
.
cursor
.
return_value
.
execute
.
side_effect
=
DatabaseError
response
=
self
.
client
.
get
(
self
.
heartbeat_url
)
self
.
assertEqual
(
response
.
status_code
,
503
)
...
...
@@ -35,7 +35,7 @@ class HeartbeatTestCase(ModuleStoreTestCase):
self
.
assertIn
(
'SQL'
,
response_dict
)
def
test_modulestore_fail
(
self
):
with
patch
(
'heartbeat.views.modulestore'
)
as
mock_modulestore
:
with
patch
(
'
openedx.core.djangoapps.
heartbeat.views.modulestore'
)
as
mock_modulestore
:
mock_modulestore
.
return_value
.
heartbeat
.
side_effect
=
HeartbeatFailure
(
'msg'
,
'service'
)
response
=
self
.
client
.
get
(
self
.
heartbeat_url
)
self
.
assertEqual
(
response
.
status_code
,
503
)
common
/djangoapps/heartbeat/urls.py
→
openedx/core
/djangoapps/heartbeat/urls.py
View file @
c703834e
"""
Urls for verifying health (heartbeat) of the app.
"""
from
django.conf.urls
import
url
,
patterns
urlpatterns
=
patterns
(
''
,
url
(
r'^$'
,
'heartbeat.views.heartbeat'
,
name
=
'heartbeat'
),
url
(
r'^$'
,
'
openedx.core.djangoapps.
heartbeat.views.heartbeat'
,
name
=
'heartbeat'
),
)
common
/djangoapps/heartbeat/views.py
→
openedx/core
/djangoapps/heartbeat/views.py
View file @
c703834e
"""
Views for verifying the health (heartbeat) of the app.
"""
from
xmodule.modulestore.django
import
modulestore
from
dogapi
import
dog_stats_api
from
util.json_request
import
JsonResponse
...
...
@@ -7,7 +10,7 @@ from xmodule.exceptions import HeartbeatFailure
@dog_stats_api.timed
(
'edxapp.heartbeat'
)
def
heartbeat
(
request
):
def
heartbeat
(
request
):
# pylint: disable=unused-argument
"""
Simple view that a loadbalancer can check to verify that the app is up. Returns a json doc
of service id: status or message. If the status for any service is anything other than True,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment