MCPcopy
hub / github.com/pyload/pyload / checkThreadCount

Method checkThreadCount

module/ThreadManager.py:231–241  ·  view source on GitHub ↗

checks if there are need for increasing or reducing thread count

(self)

Source from the content-addressed store, hash-verified

229
230 #----------------------------------------------------------------------
231 def checkThreadCount(self):
232 """checks if there are need for increasing or reducing thread count"""
233
234 if len(self.threads) == self.core.config.get("download", "max_downloads"):
235 return True
236 elif len(self.threads) < self.core.config.get("download", "max_downloads"):
237 self.createThread()
238 else:
239 free = [x for x in self.threads if not x.active]
240 if free:
241 free[0].put("quit")
242
243
244 def cleanPycurl(self):

Callers 1

workMethod · 0.95

Calls 3

createThreadMethod · 0.95
getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected