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
fd062a9c
Commit
fd062a9c
authored
6 years ago
by
adeelehsan
Browse files
Options
Downloads
Patches
Plain Diff
Added logs
adding logs to investigate cache. learner-6943
parent
10dff07c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/certificates/views/webview.py
+6
-0
6 additions, 0 deletions
lms/djangoapps/certificates/views/webview.py
openedx/core/lib/edx_api_utils.py
+7
-2
7 additions, 2 deletions
openedx/core/lib/edx_api_utils.py
with
13 additions
and
2 deletions
lms/djangoapps/certificates/views/webview.py
+
6
−
0
View file @
fd062a9c
...
...
@@ -631,12 +631,18 @@ def _get_catalog_data_for_course(course_key):
catalog_data
=
{}
course_run_fields
=
[]
log
.
info
(
u
"
language specific template is:{lang} and include hours of effort is:{hof} for the course:{course_key}
"
.
format
(
lang
=
course_certificate_settings
.
language_specific_templates_enabled
,
hof
=
course_certificate_settings
.
include_hours_of_effort
,
course_key
=
course_key
))
if
course_certificate_settings
.
language_specific_templates_enabled
:
course_run_fields
.
append
(
'
content_language
'
)
if
course_certificate_settings
.
include_hours_of_effort
:
course_run_fields
.
extend
([
'
weeks_to_complete
'
,
'
max_effort
'
])
if
course_run_fields
:
log
.
info
(
u
'
requesting following fields:{course_run_fields} for the course:{course_key}
'
.
format
(
course_run_fields
=
course_run_fields
,
course_key
=
course_key
))
course_run_data
=
get_course_run_details
(
course_key
,
course_run_fields
)
if
course_run_data
.
get
(
'
weeks_to_complete
'
)
and
course_run_data
.
get
(
'
max_effort
'
):
try
:
...
...
This diff is collapsed.
Click to expand it.
openedx/core/lib/edx_api_utils.py
+
7
−
2
View file @
fd062a9c
...
...
@@ -55,8 +55,9 @@ def get_edx_api_data(api_config, resource, api, resource_id=None, querystring=No
cached
=
cache
.
get
(
cache_key
)
if
cached
:
log
.
info
(
"
Cached course run was returned for the course: {resource_id} and response is {cached}
"
.
format
(
resource_id
=
resource_id
,
cached
=
zunpickle
(
cached
)))
log
.
info
(
"
Cached course run was returned for the course: {resource_id} using the key:{cache_key}
"
"
and response is {cached}
"
.
format
(
resource_id
=
resource_id
,
cache_key
=
cache_key
,
cached
=
zunpickle
(
cached
)))
return
zunpickle
(
cached
)
try
:
...
...
@@ -69,6 +70,8 @@ def get_edx_api_data(api_config, resource, api, resource_id=None, querystring=No
if
resource_id
is
not
None
:
if
fields
:
log
.
info
(
"
Getting following fields:{fields} for the course:{resource_id}
"
.
format
(
fields
=
fields
,
resource_id
=
resource_id
))
results
=
get_fields
(
fields
,
response
)
else
:
results
=
response
...
...
@@ -85,6 +88,8 @@ def get_edx_api_data(api_config, resource, api, resource_id=None, querystring=No
cache_ttl
=
api_config
.
cache_ttl
if
long_term_cache
:
cache_ttl
=
api_config
.
long_term_cache_ttl
log
.
info
(
'
setting cache for the course:{resource_id} with key:{cache_key} and results:{results}
'
.
format
(
resource_id
=
resource_id
,
cache_key
=
cache_key
,
results
=
results
))
cache
.
set
(
cache_key
,
zdata
,
cache_ttl
)
return
results
...
...
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