Administrator
2023-08-10 68000f7266ea05bab89a201779f4f54136fc2ee6
bug修复
2个文件已修改
27 ■■■■ 已修改文件
l2/l2_data_manager_new.py 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/kpl_api.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -408,21 +408,21 @@
        if round(t.time() * 1000) - __start_time > 10:
            __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
                                               "获取m值数据耗时")
        if True:  # end_index - start_index < 10:
        if False:  # end_index - start_index < 10:
            cls.__start_compute_buy(code, start_index, end_index, threshold_money, capture_time, is_first_code)
        else:
            pass
            # lp = LineProfiler()
            # lp.enable()
            # lp_wrap = lp(cls.__start_compute_buy)
            # lp_wrap(code, start_index, end_index, threshold_money, capture_time, is_first_code)
            # output = io.StringIO()
            # lp.print_stats(stream=output)
            # lp.disable()
            # with open(
            #         f"/home/logs/profile/{code}_start_compute_buy_{start_index}_{end_index}.txt",
            #         'w') as f:
            #     f.write(output.getvalue())
            # pass
            lp = LineProfiler()
            lp.enable()
            lp_wrap = lp(cls.__start_compute_buy)
            lp_wrap(code, start_index, end_index, threshold_money, capture_time, is_first_code)
            output = io.StringIO()
            lp.print_stats(stream=output)
            lp.disable()
            with open(
                    f"/home/logs/profile/{code}_start_compute_buy_{start_index}_{end_index}.txt",
                    'w') as f:
                f.write(output.getvalue())
    # 测试专用
    @classmethod
third_data/kpl_api.py
@@ -23,7 +23,6 @@
        raise Exception("请求出错")
    result = response.text
    result = json.loads(result)
    print(result)
    if int(result["errcode"]) != 0:
        return None
    return result["ListJX"] if result["ListJX"] else result["List"]