Commit 992d3c41 by rfkelly0

ConnectionManagerFS: dont poll the remote_fs in __init__, it can be really slow

parent b5b04d5d
...@@ -141,7 +141,7 @@ class ConnectionManagerFS(WrapFS): ...@@ -141,7 +141,7 @@ class ConnectionManagerFS(WrapFS):
poll_interval = 1 poll_interval = 1
def __init__(self,fs,poll_interval=None): def __init__(self,fs,poll_interval=None,connected=True):
if poll_interval is not None: if poll_interval is not None:
self.poll_interval = poll_interval self.poll_interval = poll_interval
if isinstance(fs,FS): if isinstance(fs,FS):
...@@ -162,12 +162,7 @@ class ConnectionManagerFS(WrapFS): ...@@ -162,12 +162,7 @@ class ConnectionManagerFS(WrapFS):
self._fskwds = {} self._fskwds = {}
self._connection_cond = threading.Condition() self._connection_cond = threading.Condition()
self._poll_thread = None self._poll_thread = None
try: self.connected = connected
self.wrapped_fs.isdir("")
except RemoteConnectionError:
self.connected = False
else:
self.connected = True
@property @property
def wrapped_fs(self): def wrapped_fs(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment