mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 08:38:20 +08:00
Refactor: Faster device retrying
This commit is contained in:
@@ -86,6 +86,21 @@ class PackageNotInstalled(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def retry_sleep(trial):
|
||||
# First trial
|
||||
if trial == 0:
|
||||
pass
|
||||
# Failed once, fast retry
|
||||
elif trial == 1:
|
||||
pass
|
||||
# Failed twice
|
||||
elif trial == 2:
|
||||
time.sleep(1)
|
||||
# Failed more
|
||||
else:
|
||||
time.sleep(RETRY_DELAY)
|
||||
|
||||
|
||||
def handle_adb_error(e):
|
||||
"""
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user