From ca1a426182ea09cfbdb6c931955db22e58a5454e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 9 May 2023 08:34:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20while=20=E5=BE=AA=E7=8E=AF=E5=81=9Acard?= =?UTF-8?q?=5Fdoor=5Fauthority=E7=9A=84=E8=A1=A5=E5=81=BF=E6=9C=BA?= =?UTF-8?q?=E5=88=B63?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/services.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/hrm/services.py b/apps/hrm/services.py index 2f160345..2a18b353 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -193,18 +193,14 @@ class HrmService: "cardPrivilegeDetails": details } ind = 0 - exception = None while ind < 6: time.sleep(6) try: dhClient.request(**dhapis['card_door_authority'], json=json_data) - exception = None except Exception as e: - exception = e ind = ind + 1 - if exception: - raise exception - # while ind < 6: + if ind >= 6: + raise e # time.sleep(5) # is_ok, res = dhClient.request(**dhapis['card_door_authority'], json=json_data, raise_exception=False) # if is_ok == 'success':