MCPcopy Index your code
hub / github.com/pyload/pyload / work

Method work

module/ThreadManager.py:132–157  ·  view source on GitHub ↗

run all task which have to be done (this is for repetivive call by core)

(self)

Source from the content-addressed store, hash-verified

130
131
132 def work(self):
133 """run all task which have to be done (this is for repetivive call by core)"""
134 try:
135 self.tryReconnect()
136 except Exception, e:
137 self.log.error(_("Reconnect Failed: %s") % str(e) )
138 self.reconnecting.clear()
139 if self.core.debug:
140 print_exc()
141 self.checkThreadCount()
142
143 try:
144 self.assignJob()
145 except Exception, e:
146 self.log.warning("Assign job error", e)
147 if self.core.debug:
148 print_exc()
149
150 sleep(0.5)
151 self.assignJob()
152 #it may be failed non critical so we try it again
153
154 if (self.infoCache or self.infoResults) and self.timestamp < time():
155 self.infoCache.clear()
156 self.infoResults.clear()
157 self.log.debug("Cleared Result cache")
158
159 #----------------------------------------------------------------------
160 def tryReconnect(self):

Callers

nothing calls this directly

Calls 6

tryReconnectMethod · 0.95
checkThreadCountMethod · 0.95
assignJobMethod · 0.95
_Function · 0.50
errorMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected