| | |
| | | import time |
| | | |
| | | from huaxin_client import l2_client_test, l1_subscript_codes_manager |
| | | from log_module.log import logger_local_huaxin_l2_upload |
| | | |
| | | |
| | | def run(): |
| | |
| | | cpu_count = 16 |
| | | page_size = int(len(codes) / cpu_count) + 1 |
| | | |
| | | big_order_queue = multiprocessing.Queue() |
| | | |
| | | for i in range(cpu_count): |
| | | process = multiprocessing.Process(target=l2_client_test.run, |
| | | args=(codes[i * page_size:(i + 1) * page_size],)) |
| | | args=(codes[i * page_size:(i + 1) * page_size], big_order_queue,)) |
| | | process.start() |
| | | |
| | | while True: |
| | | try: |
| | | data = big_order_queue.get() |
| | | logger_local_huaxin_l2_upload.info(f"{data}") |
| | | except: |
| | | pass |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | run() |