MCPcopy Create free account
hub / github.com/adobe/Marinus / process_data

Function process_data

python3_cron_scripts/zgrab_http_domain.py:239–266  ·  view source on GitHub ↗

Does the per-thread getting of value, running the sub-function, and marking a completion.

(logger, tnum, q, port, command, zone, zgrab_collection)

Source from the content-addressed store, hash-verified

237
238
239def process_data(logger, tnum, q, port, command, zone, zgrab_collection):
240 """
241 Does the per-thread getting of value, running the sub-function, and marking a completion.
242 """
243 while not global_exit_flag:
244 global_queue_lock.acquire()
245 if not global_work_queue.empty():
246 data = []
247 i = 0
248 while i < 5:
249 data.append(q.get())
250 i = i + 1
251 if global_work_queue.empty():
252 break
253 global_queue_lock.release()
254 logger.debug("Thread %s processing %s" % (str(tnum), str(data)))
255 try:
256 process_thread(
257 logger, data, port, command, zone, zgrab_collection, tnum
258 )
259 except Exception as ex:
260 logger.error("Thread error processing: " + str(data))
261 logger.error(str(ex))
262 for _ in range(0, i):
263 q.task_done()
264 else:
265 global_queue_lock.release()
266 time.sleep(1)
267
268
269class ZgrabThread(threading.Thread):

Callers 1

runMethod · 0.70

Calls 1

process_threadFunction · 0.70

Tested by

no test coverage detected