Fix: Daily app restart

This commit is contained in:
LmeSzinc 2021-09-25 00:51:51 +08:00
parent 495242cbc2
commit 672f5b4608
2 changed files with 8 additions and 1 deletions

View File

@ -160,13 +160,20 @@ class AzurLaneAutoScript:
mode=self.config.Campaign_Mode) mode=self.config.Campaign_Mode)
def loop(self): def loop(self):
is_first = True
while 1: while 1:
if is_first and self.config.task == 'Restart':
logger.info('Skip task `Restart` at scheduler start')
self.config.task_delay(server_update=True)
del self.__dict__['config']
logger.info(f'Scheduler: Start task `{self.config.task}`') logger.info(f'Scheduler: Start task `{self.config.task}`')
logger.hr(self.config.task, level=0) logger.hr(self.config.task, level=0)
success = self.run(inflection.underscore(self.config.task)) success = self.run(inflection.underscore(self.config.task))
logger.info(f'Scheduler: End task `{self.config.task}`') logger.info(f'Scheduler: End task `{self.config.task}`')
del self.__dict__['config'] del self.__dict__['config']
is_first = False
if success: if success:
continue continue

View File

@ -102,7 +102,7 @@ class LoginHandler(Combat):
self.device.app_start() self.device.app_start()
self.handle_app_login() self.handle_app_login()
self.ensure_no_unfinished_campaign() self.ensure_no_unfinished_campaign()
self.config.Scheduler_Enable = False self.config.task_delay(server_update=True)
def ensure_no_unfinished_campaign(self, confirm_wait=3): def ensure_no_unfinished_campaign(self, confirm_wait=3):
""" """