Administrator
2023-08-02 bfbcb5aefb4eb7b235628728d150dfd7ade50442
redis缓存加入内存缓存
1个文件已修改
14 ■■■■ 已修改文件
l2/l2_data_manager_new.py 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -342,9 +342,7 @@
                else:
                    # 未挂单,时间相差不大才能挂单
                    if l2.l2_data_util.L2DataUtil.is_same_time(now_time_str, latest_time):
                        cls.__process_not_order(code, start_index, end_index, capture_timestamp, is_first_code)
            logger_l2_process.info("code:{} 处理数据范围: {}-{} 处理时间:{} 截图时间戳:{}", code, add_datas[0]["index"],
                                   add_datas[-1]["index"], round(t.time() * 1000) - __start_time,
@@ -575,7 +573,17 @@
        if not is_first_code:
            can, need_clear_data, reason = cls.__can_buy(code)
        else:
            can, need_clear_data, reason = cls.__can_buy_first(code)
            # can, need_clear_data, reason = cls.__can_buy_first(code)
            lp = LineProfiler()
            lp.enable()
            lp_wrap = lp(cls.__can_buy_first)
            can, need_clear_data, reason = lp_wrap(code)
            output = io.StringIO()
            lp.print_stats(stream=output)
            lp.disable()
            with open(f"/home/logs/profile/{code}_can_buy_first.txt", 'w') as f:
                f.write(output.getvalue())
        __start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - __start_time, "最后判断是否能下单", force=True)
        # 删除虚拟下单
        if code in cls.unreal_buy_dict: