mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-08 12:07:36 +08:00
Opt: Check game server maintenance after GUI update event
This commit is contained in:
parent
e8bfd08eba
commit
821b1b3295
16
alas.py
16
alas.py
@ -429,6 +429,13 @@ class AzurLaneAutoScript:
|
||||
failure_record = {}
|
||||
|
||||
while 1:
|
||||
# Check update event from GUI
|
||||
if self.stop_event is not None:
|
||||
if self.stop_event.is_set():
|
||||
logger.info("Update event detected")
|
||||
logger.info(f"Alas [{self.config_name}] exited.")
|
||||
break
|
||||
# Check game server maintenance
|
||||
self.checker.wait_until_available()
|
||||
if self.checker.is_recovered():
|
||||
# There is an accidental bug hard to reproduce
|
||||
@ -438,15 +445,10 @@ class AzurLaneAutoScript:
|
||||
del_cached_property(self, 'config')
|
||||
logger.info('Server or network is recovered. Restart game client')
|
||||
self.run('restart')
|
||||
|
||||
if self.stop_event is not None:
|
||||
if self.stop_event.is_set():
|
||||
logger.info("Update event detected")
|
||||
logger.info(f"Alas [{self.config_name}] exited.")
|
||||
break
|
||||
# Get task
|
||||
task = self.get_next_task()
|
||||
# Init device and change server
|
||||
_ = self.device
|
||||
|
||||
# Skip first restart
|
||||
if is_first and task == 'Restart':
|
||||
logger.info('Skip task `Restart` at scheduler start')
|
||||
|
Loading…
Reference in New Issue
Block a user