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
1ecba9a9
Commit
1ecba9a9
authored
Mar 24, 2016
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setting request timeouts for edx notes.
TNL-2444
parent
6541ce3e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
lms/djangoapps/edxnotes/helpers.py
+2
-1
lms/djangoapps/edxnotes/tests.py
+4
-2
lms/envs/aws.py
+3
-0
lms/envs/common.py
+3
-0
No files found.
lms/djangoapps/edxnotes/helpers.py
View file @
1ecba9a9
...
...
@@ -99,7 +99,8 @@ def send_request(user, course_id, page, page_size, path="", text=None):
headers
=
{
"x-annotator-auth-token"
:
get_edxnotes_id_token
(
user
)
},
params
=
params
params
=
params
,
timeout
=
(
settings
.
EDXNOTES_CONNECT_TIMEOUT
,
settings
.
EDXNOTES_READ_TIMEOUT
)
)
except
RequestException
:
log
.
error
(
"Failed to connect to edx-notes-api: url=
%
s, params=
%
s"
,
url
,
str
(
params
))
...
...
lms/djangoapps/edxnotes/tests.py
View file @
1ecba9a9
...
...
@@ -782,7 +782,8 @@ class EdxNotesHelpersTest(ModuleStoreTestCase):
"highlight"
:
True
,
'page'
:
1
,
'page_size'
:
25
,
}
},
timeout
=
(
settings
.
EDXNOTES_CONNECT_TIMEOUT
,
settings
.
EDXNOTES_READ_TIMEOUT
)
)
@override_settings
(
EDXNOTES_PUBLIC_API
=
"http://example.com"
)
...
...
@@ -809,7 +810,8 @@ class EdxNotesHelpersTest(ModuleStoreTestCase):
"course_id"
:
unicode
(
self
.
course
.
id
),
'page'
:
helpers
.
DEFAULT_PAGE
,
'page_size'
:
helpers
.
DEFAULT_PAGE_SIZE
,
}
},
timeout
=
(
settings
.
EDXNOTES_CONNECT_TIMEOUT
,
settings
.
EDXNOTES_READ_TIMEOUT
)
)
def
test_get_course_position_no_chapter
(
self
):
...
...
lms/envs/aws.py
View file @
1ecba9a9
...
...
@@ -723,6 +723,9 @@ PROFILE_IMAGE_DEFAULT_FILENAME = 'images/profiles/default'
EDXNOTES_PUBLIC_API
=
ENV_TOKENS
.
get
(
'EDXNOTES_PUBLIC_API'
,
EDXNOTES_PUBLIC_API
)
EDXNOTES_INTERNAL_API
=
ENV_TOKENS
.
get
(
'EDXNOTES_INTERNAL_API'
,
EDXNOTES_INTERNAL_API
)
EDXNOTES_CONNECT_TIMEOUT
=
ENV_TOKENS
.
get
(
'EDXNOTES_CONNECT_TIMEOUT'
,
EDXNOTES_CONNECT_TIMEOUT
)
EDXNOTES_READ_TIMEOUT
=
ENV_TOKENS
.
get
(
'EDXNOTES_READ_TIMEOUT'
,
EDXNOTES_READ_TIMEOUT
)
##### Credit Provider Integration #####
CREDIT_PROVIDER_SECRET_KEYS
=
AUTH_TOKENS
.
get
(
"CREDIT_PROVIDER_SECRET_KEYS"
,
{})
...
...
lms/envs/common.py
View file @
1ecba9a9
...
...
@@ -1024,6 +1024,9 @@ PAYMENT_REPORT_GENERATOR_GROUP = 'shoppingcart_report_access'
EDXNOTES_PUBLIC_API
=
'http://localhost:8120/api/v1'
EDXNOTES_INTERNAL_API
=
'http://localhost:8120/api/v1'
EDXNOTES_CONNECT_TIMEOUT
=
0.5
# time in seconds
EDXNOTES_READ_TIMEOUT
=
1.5
# time in seconds
########################## Parental controls config #######################
# The age at which a learner no longer requires parental consent, or None
...
...
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