fix: while 循环做card_door_authority的补偿机制3
This commit is contained in:
parent
a395817028
commit
ca1a426182
|
@ -193,18 +193,14 @@ class HrmService:
|
||||||
"cardPrivilegeDetails": details
|
"cardPrivilegeDetails": details
|
||||||
}
|
}
|
||||||
ind = 0
|
ind = 0
|
||||||
exception = None
|
|
||||||
while ind < 6:
|
while ind < 6:
|
||||||
time.sleep(6)
|
time.sleep(6)
|
||||||
try:
|
try:
|
||||||
dhClient.request(**dhapis['card_door_authority'], json=json_data)
|
dhClient.request(**dhapis['card_door_authority'], json=json_data)
|
||||||
exception = None
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exception = e
|
|
||||||
ind = ind + 1
|
ind = ind + 1
|
||||||
if exception:
|
if ind >= 6:
|
||||||
raise exception
|
raise e
|
||||||
# while ind < 6:
|
|
||||||
# time.sleep(5)
|
# time.sleep(5)
|
||||||
# is_ok, res = dhClient.request(**dhapis['card_door_authority'], json=json_data, raise_exception=False)
|
# is_ok, res = dhClient.request(**dhapis['card_door_authority'], json=json_data, raise_exception=False)
|
||||||
# if is_ok == 'success':
|
# if is_ok == 'success':
|
||||||
|
|
Loading…
Reference in New Issue