| | |
| | | if code not in tmep_order_detail_queue_dict: |
| | | tmep_order_detail_queue_dict[code] = queue.Queue() |
| | | tag = l2_data_transaction_protocol.get_mmap_tag_name_for_l2_order(code) |
| | | with contextlib.closing( |
| | | mmap.mmap(-1, 1000 * 100, tag, |
| | | access=mmap.ACCESS_WRITE)) as _mmap: |
| | | # with contextlib.closing( |
| | | # mmap.mmap(-1, 1000 * 100, tag, |
| | | # access=mmap.ACCESS_WRITE)) as _mmap: |
| | | if True: |
| | | while True: |
| | | # print("order task") |
| | | try: |
| | |
| | | udatas.append(temp) |
| | | if udatas: |
| | | start_time = time.time() |
| | | # upload_data(code, "l2_order", udatas) |
| | | l2_data_transaction_protocol.send_l2_order_detail(pipe, _mmap, code, udatas) |
| | | upload_data(code, "l2_order", udatas) |
| | | # l2_data_transaction_protocol.send_l2_order_detail(pipe, _mmap, code, udatas) |
| | | use_time = int((time.time() - start_time) * 1000) |
| | | if use_time > 20: |
| | | logger_local_huaxin_l2_upload.info(f"{code}-上传代码耗时:{use_time}ms") |