diff --git a/module/device/device.py b/module/device/device.py index 673037769..932240989 100644 --- a/module/device/device.py +++ b/module/device/device.py @@ -71,11 +71,14 @@ class Device(Screenshot, Control, AppControl): stuck_timer = Timer(60, count=60).start() def __init__(self, *args, **kwargs): - for _ in range(2): + for trial in range(4): try: super().__init__(*args, **kwargs) break except EmulatorNotRunningError: + if trial >= 3: + logger.critical('Failed to start emulator after 3 trial') + raise RequestHumanTakeover # Try to start emulator if self.emulator_instance is not None: self.emulator_start() @@ -84,7 +87,7 @@ class Device(Screenshot, Control, AppControl): f'No emulator with serial "{self.config.Emulator_Serial}" found, ' f'please set a correct serial' ) - raise + raise RequestHumanTakeover # Auto-fill emulator info if IS_WINDOWS and self.config.EmulatorInfo_Emulator == 'auto': diff --git a/module/device/platform/platform_windows.py b/module/device/platform/platform_windows.py index ce5c2d177..5fd4a5a7f 100644 --- a/module/device/platform/platform_windows.py +++ b/module/device/platform/platform_windows.py @@ -221,7 +221,7 @@ class PlatformWindows(PlatformBase, EmulatorManager): logger.info(f'Found azurlane packages: {m}') interval = Timer(0.5).start() - timeout = Timer(300).start() + timeout = Timer(180).start() new_window = 0 while 1: interval.wait()