summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/ThreadManager.py2
-rw-r--r--module/config/default.conf (renamed from module/config/default.config)4
-rw-r--r--module/plugins/Plugin.py17
3 files changed, 17 insertions, 6 deletions
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index e6d4747b0..6ab651cee 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -73,7 +73,7 @@ class ThreadManager:
#----------------------------------------------------------------------
def checkReconnect(self):
"""checks if reconnect needed"""
- active = [x.active.plugin.wantReconnect for x in self.threads if x.active]
+ active = [x.active.plugin.wantReconnect and x.active.plugin.waiting for x in self.threads if x.active]
if active.count(True) > 0 and len(active) == active.count(True):
self.reconnecting.set()
diff --git a/module/config/default.config b/module/config/default.conf
index 7a9b7a93c..c71005bd3 100644
--- a/module/config/default.config
+++ b/module/config/default.conf
@@ -9,7 +9,7 @@ ssl - "SSL":
str key : "SSL Key" = ssl.key
webinterface - "Webinterface":
bool activated : "Activated" = True
- str server : "Server" = builtin #builtin;lighttpd;nginx;fastcgi
+ builtin;lighttpd;nginx;fastcgi server : "Server" = builtin
bool https : "Use HTTPS" = False
ip host : "IP" = 0.0.0.0
int port : "Port" = 8001
@@ -23,7 +23,7 @@ log - "Log":
str log_folder : "Folder" = Logs
int log_count : "Count" = 5
general - "General":
- str language : "Language" = de #input="en;de;fr;nl;pl"
+ en;de;fr;nl;pl language : "Language" = de
str download_folder : "Download Folder" = Downloads
int max_downloads : "Max Parallel Downloads" = 3
str link_file : "File For Links" = links.txt
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 5a53b4e47..69e398439 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -73,7 +73,8 @@ class Plugin(object):
self.multiDL = True
self.waitUntil = 0 # time() + wait in seconds
-
+ self.waiting = False
+
self.premium = False
self.ocr = None # captcha reader instance
@@ -142,9 +143,19 @@ class Plugin(object):
""" set the wait time to specified seconds """
self.pyfile.waitUntil = time() + int(seconds)
- def wait():
+ def wait(self):
""" waits the time previously set """
- if self.pyfile.abort: raise Abort
+ self.waiting = True
+
+ while self.pyfile.waitUntil < time():
+ self.thread.m.reconnecting.wait(2)
+
+ if self.pyfile.abort: raise Abort
+ if self.thread.m.reconnecting.isSet():
+ self.waiting = False
+ raise Reconnect
+
+ self.waiting = False
def fail(self, reason):
""" fail and give reason """