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
a0129ccb
Commit
a0129ccb
authored
Apr 25, 2017
by
Renzo Lucioni
Committed by
GitHub
Apr 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14964 from edx/release-mergeback-to-master
Merge release back to master
parents
3908512a
ef606d6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
openedx/core/lib/edx_api_utils.py
+5
-2
No files found.
openedx/core/lib/edx_api_utils.py
View file @
a0129ccb
...
...
@@ -8,6 +8,7 @@ from django.core.exceptions import ImproperlyConfigured
from
edx_rest_api_client.client
import
EdxRestApiClient
from
provider.oauth2.models
import
Client
from
openedx.core.lib.cache_utils
import
zpickle
,
zunpickle
from
openedx.core.lib.token_utils
import
JwtBuilder
...
...
@@ -46,10 +47,11 @@ def get_edx_api_data(api_config, resource, api, resource_id=None, querystring=No
if
cache_key
:
cache_key
=
'{}.{}'
.
format
(
cache_key
,
resource_id
)
if
resource_id
is
not
None
else
cache_key
cache_key
+=
'.zpickled'
cached
=
cache
.
get
(
cache_key
)
if
cached
:
return
cached
return
zunpickle
(
cached
)
try
:
endpoint
=
getattr
(
api
,
resource
)
...
...
@@ -67,7 +69,8 @@ def get_edx_api_data(api_config, resource, api, resource_id=None, querystring=No
return
no_data
if
cache_key
:
cache
.
set
(
cache_key
,
results
,
api_config
.
cache_ttl
)
zdata
=
zpickle
(
results
)
cache
.
set
(
cache_key
,
zdata
,
api_config
.
cache_ttl
)
return
results
...
...
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