From 457f3d4ca0c33ea41055de2e45c4218e3f541d02 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 15 八月 2023 14:02:38 +0800 Subject: [PATCH] ++++++++++++++++ bug修复- --- huaxin_api/l1_client.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/huaxin_api/l1_client.py b/huaxin_api/l1_client.py index 267b96d..a624e95 100644 --- a/huaxin_api/l1_client.py +++ b/huaxin_api/l1_client.py @@ -58,7 +58,12 @@ class MdSpi(xmdapi.CTORATstpXMdSpi): def __init__(self, api): - self.codes_sh, self.codes_sz = get_level1_codes() + for i in range(3): + try: + self.codes_sh, self.codes_sz = get_level1_codes() + break + except: + time.sleep(2) xmdapi.CTORATstpXMdSpi.__init__(self) self.__api = api @@ -150,7 +155,6 @@ {"type": type_, "data": {"data": datas}}) if pipe_l2 is not None: pipe_l2.send(fdata) - def run(pipe_l2): -- Gitblit v1.8.0