Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
File Transfer Service
fts-rest
Commits
8843f925
Commit
8843f925
authored
Jul 20, 2016
by
Alejandro Alvarez Ayllon
Browse files
FTS-636
: Add connectTimeout and timeout to Context
Pass it to the request class
parent
73e98dac
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fts3/rest/client/context.py
View file @
8843f925
...
...
@@ -145,7 +145,8 @@ class Context(object):
raise
BadEndpoint
(
"%s (%s)"
%
(
self
.
endpoint
,
str
(
e
))),
None
,
sys
.
exc_info
()[
2
]
return
endpoint_info
def
__init__
(
self
,
endpoint
,
ucert
=
None
,
ukey
=
None
,
verify
=
True
,
access_token
=
None
,
no_creds
=
False
,
capath
=
None
,
request_class
=
PycurlRequest
):
def
__init__
(
self
,
endpoint
,
ucert
=
None
,
ukey
=
None
,
verify
=
True
,
access_token
=
None
,
no_creds
=
False
,
capath
=
None
,
request_class
=
PycurlRequest
,
connectTimeout
=
30
,
timeout
=
30
):
self
.
passwd
=
None
self
.
_set_endpoint
(
endpoint
)
...
...
@@ -160,9 +161,9 @@ class Context(object):
self
.
_set_x509
(
ucert
,
ukey
)
self
.
_requester
=
request_class
(
self
.
ucert
,
self
.
ukey
,
passwd
=
self
.
passwd
,
verify
=
verify
,
access_token
=
self
.
access_token
,
capath
=
capath
)
self
.
ucert
,
self
.
ukey
,
passwd
=
self
.
passwd
,
verify
=
verify
,
access_token
=
self
.
access_token
,
capath
=
capath
,
connectTimeout
=
connectTimeout
,
timeout
=
timeout
)
self
.
endpoint_info
=
self
.
_validate_endpoint
()
# Log obtained information
log
.
debug
(
"Using endpoint: %s"
%
self
.
endpoint_info
[
'url'
])
...
...
Write
Preview
Supports
Markdown
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