Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
6a244a3f
Commit
6a244a3f
authored
7 years ago
by
Christina Roberts
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #15284 from edx/christina/add-middleware-guid
Synchronous celery tasks clear the request cache
parents
14fed7a7
d9592fc4
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/monitoring_utils/middleware.py
+5
-1
5 additions, 1 deletion
openedx/core/djangoapps/monitoring_utils/middleware.py
with
5 additions
and
1 deletion
openedx/core/djangoapps/monitoring_utils/middleware.py
+
5
−
1
View file @
6a244a3f
...
...
@@ -114,7 +114,11 @@ class MonitoringMemoryMiddleware(object):
"""
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
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment