diff options
| author | 2010-09-12 18:14:47 +0200 | |
|---|---|---|
| committer | 2010-09-12 18:14:47 +0200 | |
| commit | 0310d19cc3558943101d5daf62f578cdcf7d78d4 (patch) | |
| tree | f32a064f409690278d158f7bd593ee6d7740c347 /module | |
| parent | speedmanager time fix (diff) | |
| download | pyload-0310d19cc3558943101d5daf62f578cdcf7d78d4.tar.xz | |
couldn't connect to host fix
Diffstat (limited to 'module')
| -rw-r--r-- | module/PluginThread.py | 22 | 
1 files changed, 19 insertions, 3 deletions
| diff --git a/module/PluginThread.py b/module/PluginThread.py index b7f4806e2..ec4b3108e 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -21,6 +21,7 @@  from Queue import Queue  from threading import Thread  from time import sleep +from time import time  from time import strftime  from traceback import print_exc, format_exc  from pprint import pformat @@ -213,11 +214,26 @@ class DownloadThread(PluginThread):                  code, msg = e -                if code in (7,52,56): +                if code in (7,52,56,28):                      self.m.log.warning(_("Couldn't connect to host waiting 1 minute and retry.")) -                    sleep(60) -                    self.queue.put(pyfile) +                    wait = time() + 60 +                    while time() < wait: +                        sleep(1) +                        if pyfile.abort: +                            break + +                    if pyfile.abort: +                        self.m.log.info(_("Download aborted: %s") % pyfile.name) +                        pyfile.setStatus("aborted") + +                        pyfile.plugin.req.clean() +                        self.active = False +                        pyfile.release() +                    else: +                        self.queue.put(pyfile) +                      continue +                  else:                      print "pycurl error", code, msg                      if self.m.core.debug: | 
