From 29bf47bfd041ffb8fcf961d03fb307a64dcfdab9 Mon Sep 17 00:00:00 2001 From: guoh064 <50830808+guoh064@users.noreply.github.com> Date: Sun, 9 Aug 2026 15:04:21 +0800 Subject: [PATCH] Fix: wait_until_manjuu_disappear should wait at least 1.5s (#5093) * Fix: wait_until_manjuu_disappear should wait at least 1.5s * Opt: allow manjuu loading until stuck long but not normal stuck --- module/device/device.py | 2 +- module/handler/info_handler.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/module/device/device.py b/module/device/device.py index 0d05f3438..93f8bbada 100644 --- a/module/device/device.py +++ b/module/device/device.py @@ -67,7 +67,7 @@ class Device(Screenshot, Control, AppControl): click_record = collections.deque(maxlen=15) stuck_timer = Timer(60, count=60).start() stuck_timer_long = Timer(180, count=180).start() - stuck_long_wait_list = ['BATTLE_STATUS_S', 'PAUSE', 'LOGIN_CHECK'] + stuck_long_wait_list = ['BATTLE_STATUS_S', 'PAUSE', 'LOGIN_CHECK', 'TEMPLATE_MANJUU'] def __init__(self, *args, **kwargs): for trial in range(4): diff --git a/module/handler/info_handler.py b/module/handler/info_handler.py index 5b086931f..8ce6e9eca 100644 --- a/module/handler/info_handler.py +++ b/module/handler/info_handler.py @@ -560,11 +560,18 @@ class InfoHandler(ModuleBase): """ Wait until manjuu loading disappear. """ + # Abuse of notation. Template do not have readable name, so add string here. + self.device.stuck_record_add('TEMPLATE_MANJUU') + timer = Timer(1.5, count=3).start() while 1: self.device.screenshot() - if not self.manjuu_count(): - break - + if self.manjuu_count(): + timer.reset() + else: + if timer.reached(): + logger.info(f'Manjuu disappeared') + break + def handle_manjuu(self): """ Handle manjuu loading.