From e81214c6d448e4a53687aa4ac775ad883915c6a8 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 2 Jun 2009 16:10:14 +0200 Subject: changed reconnect method, still not working 100% correct --- module/download_thread.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'module/download_thread.py') 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) -- cgit v1.2.3