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
6a244a3f
Commit
6a244a3f
authored
Jun 08, 2017
by
Christina Roberts
Committed by
GitHub
Jun 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15284 from edx/christina/add-middleware-guid
Synchronous celery tasks clear the request cache
parents
14fed7a7
d9592fc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
openedx/core/djangoapps/monitoring_utils/middleware.py
+5
-1
No files found.
openedx/core/djangoapps/monitoring_utils/middleware.py
View file @
6a244a3f
...
@@ -114,7 +114,11 @@ class MonitoringMemoryMiddleware(object):
...
@@ -114,7 +114,11 @@ class MonitoringMemoryMiddleware(object):
"""
"""
Returns a formatted prefix for logging for the given request.
Returns a formatted prefix for logging for the given request.
"""
"""
return
u"{} request '{} {} {}'"
.
format
(
prefix
,
request
.
method
,
request
.
path
,
self
.
_cache
[
self
.
guid_key
])
# After a celery task runs, the request cache is cleared. So if celery
# tasks are running synchronously (CELERY_ALWAYS _EAGER), "guid_key"
# will no longer be in the request cache when process_response executes.
cached_guid
=
self
.
_cache
.
get
(
self
.
guid_key
)
or
u"without_guid"
return
u"{} request '{} {} {}'"
.
format
(
prefix
,
request
.
method
,
request
.
path
,
cached_guid
)
def
_memory_data
(
self
,
log_prefix
):
def
_memory_data
(
self
,
log_prefix
):
"""
"""
...
...
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