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

Function process_data

python3_cron_scripts/zgrab_port_ip.py:731–760  ·  view source on GitHub ↗

Does the per-thread getting of a value, running the sub-function, and marking a completion. None of the global variables are assigned locally in order to ensure a global reference.

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

Source from the content-addressed store, hash-verified

729
730
731def process_data(logger, tnum, q, port, command, zones_struct, zgrab_collection):
732 """
733 Does the per-thread getting of a value, running the sub-function, and marking a completion.
734 None of the global variables are assigned locally in order to ensure a global reference.
735 """
736
737 while not global_exit_flag:
738 global_queue_lock.acquire()
739 if not global_work_queue.empty():
740 data = []
741 i = 0
742 while i < global_queue_size:
743 data.append(q.get())
744 i = i + 1
745 if global_work_queue.empty():
746 break
747 global_queue_lock.release()
748 logger.debug("Thread %s processing %s" % (str(tnum), data))
749 try:
750 process_thread(
751 logger, data, port, command, zones_struct, zgrab_collection, tnum
752 )
753 except Exception as ex:
754 logger.warning("Thread error processing: " + str(data))
755 logger.warning(str(ex))
756 for _ in range(0, i):
757 q.task_done()
758 else:
759 global_queue_lock.release()
760 time.sleep(1)
761
762
763class ZgrabThread(threading.Thread):

Callers 1

runMethod · 0.70

Calls 1

process_threadFunction · 0.70

Tested by

no test coverage detected