summaryrefslogtreecommitdiffstats
path: root/pyload/threads/DownloadThread.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-19 22:07:30 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-19 22:07:30 +0100
commit64570fa1697458705a94ae57af542af920cf0054 (patch)
tree41b7ed3a614bcf2dafced869f1b9c55858453783 /pyload/threads/DownloadThread.py
parentbetter log message (diff)
downloadpyload-64570fa1697458705a94ae57af542af920cf0054.tar.xz
fixes for download scheduler
Diffstat (limited to 'pyload/threads/DownloadThread.py')
-rw-r--r--pyload/threads/DownloadThread.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/pyload/threads/DownloadThread.py b/pyload/threads/DownloadThread.py
index 3ee9466b8..6ec102c52 100644
--- a/pyload/threads/DownloadThread.py
+++ b/pyload/threads/DownloadThread.py
@@ -148,15 +148,16 @@ class DownloadThread(BaseThread):
pyfile.waitUntil = wait
pyfile.setStatus("waiting")
while time() < wait:
- sleep(1)
+ sleep(0.5)
+
if pyfile.abort:
break
if pyfile.abort:
self.log.info(_("Download aborted: %s") % pyfile.name)
pyfile.setStatus("aborted")
-
- self.clean(pyfile)
+ # don't clean, aborting function does this itself
+ # self.clean(pyfile)
else:
self.queue.put(pyfile)
@@ -215,7 +216,10 @@ class DownloadThread(BaseThread):
exc_clear()
# manager could still be waiting for it
self.isWorking.set()
- self.m.done(self)
+
+ # only done when job was not put back
+ if self.queue.empty():
+ self.m.done(self)
#pyfile.plugin.req.clean()
@@ -233,7 +237,6 @@ class DownloadThread(BaseThread):
def clean(self, pyfile):
""" set thread inactive and release pyfile """
- self.active = False
pyfile.release()
def stop(self):