summaryrefslogtreecommitdiffstats
path: root/module/download_thread.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-06-02 16:10:14 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-06-02 16:10:14 +0200
commite81214c6d448e4a53687aa4ac775ad883915c6a8 (patch)
treeed1e2cb541f9dfdb8f72f9360907d0556ad3570c /module/download_thread.py
parentnew reconnect method, hard to test (diff)
downloadpyload-e81214c6d448e4a53687aa4ac775ad883915c6a8.tar.xz
changed reconnect method, still not working 100% correct
Diffstat (limited to 'module/download_thread.py')
-rw-r--r--module/download_thread.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/module/download_thread.py b/module/download_thread.py
index 80a1d4c30..62ac633ee 100644
--- a/module/download_thread.py
+++ b/module/download_thread.py
@@ -96,17 +96,17 @@ class Download_Thread(threading.Thread):
def download(self, pyfile):
status = pyfile.status
pyfile.prepareDownload()
- print "dl prepared", status.filename
+ print "dl prepared", status.filename
- rnd = random.randint(0,2)
- if rnd == 0:
- print status.filename, "want reconnect"
- status.want_reconnect = True
- status.waituntil = time() + 60
- else:
- status.waituntil = 0
- status.want_reconnect = False
- print status.filename, "doesnt want reconnect"
+ rnd = random.randint(0,1)
+ if rnd == 0:
+ print status.filename, "want reconnect"
+ status.want_reconnect = True
+ status.waituntil = time() + 60
+ else:
+ status.waituntil = 0
+ status.want_reconnect = False
+ print status.filename, "doesnt want reconnect"
if not status.exists:
@@ -116,15 +116,15 @@ class Download_Thread(threading.Thread):
reconnect = self.parent.init_reconnect()
if reconnect:
status.type = "reconnected"
- status.want_reconnect = False
+ status.want_reconnect = False
return False
- status.type = "waiting"
+ status.type = "waiting"
while (time() < status.waituntil):
if status.want_reconnect and self.parent.reconnecting:
status.type = "reconnected"
- status.want_reconnect = False
+ status.want_reconnect = False
return False
sleep(1)