diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-02 12:26:11 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-02 12:26:11 +0200 |
commit | ae0a6546752e95735cb8d4086127540619f44419 (patch) | |
tree | 1cc0ada2fb6ae8a54c25d392528c809d62f04641 /module/ThreadManager.py | |
parent | Rapidshare, Netload, Uploaded updated. (diff) | |
download | pyload-ae0a6546752e95735cb8d4086127540619f44419.tar.xz |
reconnect fix
Diffstat (limited to 'module/ThreadManager.py')
-rw-r--r-- | module/ThreadManager.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/module/ThreadManager.py b/module/ThreadManager.py index 6ab651cee..a49885297 100644 --- a/module/ThreadManager.py +++ b/module/ThreadManager.py @@ -21,6 +21,8 @@ from threading import Event import PluginThread +from time import sleep + ######################################################################## class ThreadManager: """manages the download threads, assign jobs, reconnect etc""" @@ -73,14 +75,26 @@ class ThreadManager: #---------------------------------------------------------------------- def checkReconnect(self): """checks if reconnect needed""" - active = [x.active.plugin.wantReconnect and x.active.plugin.waiting for x in self.threads if x.active] + if not (self.core.server_methods.is_time_reconnect() and self.core.config["reconnect"]["activated"] ): + return False + + active = [x.active.plugin.wantReconnect and x.active.plugin.waiting for x in self.threads if x.active] + print active if active.count(True) > 0 and len(active) == active.count(True): self.reconnecting.set() #Do reconnect self.log.info(_("Reconnecting")) + while [x.active.plugin.waiting for x in self.threads if x.active].count(True) != 0: + sleep(0.25) + + + print "wating finsihed" + + print "do reconnect" + self.reconnecting.clear() #---------------------------------------------------------------------- |