summaryrefslogtreecommitdiffstats
path: root/module/ThreadManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-07 18:47:34 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-07 18:47:34 +0200
commitdf0e93c878c2f6cf1c914516a7c754edfea7d3ce (patch)
tree11314814e60fe354f8b38fbd1bb04a59a778cb68 /module/ThreadManager.py
parentrecycle sqlite connection (diff)
downloadpyload-df0e93c878c2f6cf1c914516a7c754edfea7d3ce.tar.xz
files.mail.ru closed #101
Diffstat (limited to 'module/ThreadManager.py')
-rw-r--r--module/ThreadManager.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index 73e9efe56..6d7171222 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -165,19 +165,23 @@ class ThreadManager:
pass
+ def cleanPyCurl(self):
+ if self.downloadingIds() or self.processingIds():
+ return False
+ pycurl.global_cleanup()
+ pycurl.global_init(pycurl.GLOBAL_DEFAULT)
+ self.downloaded = 0
+ self.log.debug("Cleaned up pycurl")
+ return True
+
#----------------------------------------------------------------------
def assignJob(self):
"""assing a job to a thread if possible"""
if self.pause or not self.core.server_methods.is_time_download(): return
- if self.downloaded > 20:
- if self.downloadingIds() or self.processingIds():
- return
- pycurl.global_cleanup()
- pycurl.global_init(pycurl.GLOBAL_DEFAULT)
- self.downloaded = 0
- self.log.debug("Cleaned up pycurl")
+ #if self.downloaded > 20:
+ # if not self.cleanPyCurl(): return
free = [x for x in self.threads if not x.active]