Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
907ea7c9
Commit
907ea7c9
authored
Oct 17, 2014
by
Gero Müller
Browse files
add 60 sec request timeout
parent
6ee2872f
Changes
2
Hide whitespace changes
Inline
Side-by-side
vispa/workspace.py
View file @
907ea7c9
...
...
@@ -201,6 +201,8 @@ class WrappedChannelFile(object):
class
RpycConnection
(
rpyc
.
Connection
):
REQUEST_TIMEOUT
=
60
def
_send_request
(
self
,
seq
,
handler
,
args
):
self
.
_send
(
rpyc
.
core
.
consts
.
MSG_REQUEST
,
seq
,
(
handler
,
self
.
_box
(
args
)))
return
seq
...
...
@@ -223,8 +225,12 @@ class RpycConnection(rpyc.Connection):
"""
seq
=
next
(
self
.
_seqcounter
)
self
.
_send_request
(
seq
,
handler
,
args
)
start
=
time
.
time
()
while
seq
not
in
self
.
_sync_replies
:
self
.
serve
(
0.1
)
if
(
start
+
self
.
REQUEST_TIMEOUT
)
<
time
.
time
():
break
isexc
,
obj
=
self
.
_sync_replies
.
pop
(
seq
)
if
isexc
:
raise
obj
...
...
vispa/workspace_loader.py
View file @
907ea7c9
...
...
@@ -256,6 +256,9 @@ class ThreadPool:
class
RpycConnection
(
rpyc
.
Connection
):
REQUEST_TIMEOUT
=
60
def
_send_request
(
self
,
seq
,
handler
,
args
):
self
.
_send
(
rpyc
.
core
.
consts
.
MSG_REQUEST
,
seq
,
(
handler
,
self
.
_box
(
args
)))
return
seq
...
...
@@ -278,8 +281,12 @@ class RpycConnection(rpyc.Connection):
"""
seq
=
next
(
self
.
_seqcounter
)
self
.
_send_request
(
seq
,
handler
,
args
)
start
=
time
.
time
()
while
seq
not
in
self
.
_sync_replies
:
self
.
serve
(
0.1
)
if
(
start
+
self
.
REQUEST_TIMEOUT
)
<
time
.
time
():
break
isexc
,
obj
=
self
.
_sync_replies
.
pop
(
seq
)
if
isexc
:
raise
obj
...
...
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