Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
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
OpenEdx
pyfs
Commits
e9c3bf44
Commit
e9c3bf44
authored
Apr 10, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConnectionManagerFS: allow wait_for_connection to force waiting even if apparently connected
parent
f001445d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
fs/remote.py
+4
-2
No files found.
fs/remote.py
View file @
e9c3bf44
...
...
@@ -328,9 +328,11 @@ class ConnectionManagerFS(LazyFS):
self
.
_connection_cond
=
threading
.
Condition
()
self
.
_poll_sleeper
=
threading
.
Event
()
def
wait_for_connection
(
self
,
timeout
=
None
):
def
wait_for_connection
(
self
,
timeout
=
None
,
force_wait
=
False
):
self
.
_connection_cond
.
acquire
()
try
:
if
force_wait
:
self
.
connected
=
False
if
not
self
.
connected
:
if
not
self
.
_poll_thread
:
target
=
self
.
_poll_connection
...
...
@@ -344,7 +346,7 @@ class ConnectionManagerFS(LazyFS):
def
_poll_connection
(
self
):
while
not
self
.
connected
and
not
self
.
closed
:
try
:
self
.
wrapped_fs
.
isdir
(
"
"
)
self
.
wrapped_fs
.
getinfo
(
"/
"
)
except
RemoteConnectionError
:
self
.
_poll_sleeper
.
wait
(
self
.
poll_interval
)
self
.
_poll_sleeper
.
clear
()
...
...
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