Переглянути джерело

perf(module): Add task name when notify pushing

huangrunheng 2 роки тому
батько
коміт
ae2997fb75
2 змінених файлів з 6 додано та 6 видалено
  1. 5 5
      script.py
  2. 1 1
      tasks/Hyakkiyakou/prepare/get_images.py

+ 5 - 5
script.py

@@ -361,7 +361,7 @@ class Script:
             self.save_error_log()
             self.save_error_log()
             logger.warning(f'Game stuck, {self.device.package} will be restarted in 10 seconds')
             logger.warning(f'Game stuck, {self.device.package} will be restarted in 10 seconds')
             logger.warning('If you are playing by hand, please stop Alas')
             logger.warning('If you are playing by hand, please stop Alas')
-            self.config.notifier.push(title='crashed', content=f"<{self.config_name}> GameStuckError or GameTooManyClickError")
+            self.config.notifier.push(title=command, content=f"<{self.config_name}> GameStuckError or GameTooManyClickError")
             self.config.task_call('Restart')
             self.config.task_call('Restart')
             self.device.sleep(10)
             self.device.sleep(10)
             return False
             return False
@@ -378,22 +378,22 @@ class Script:
             # 这个还不重要 留着坑填
             # 这个还不重要 留着坑填
             logger.critical('Game page unknown')
             logger.critical('Game page unknown')
             self.save_error_log()
             self.save_error_log()
-            self.config.notifier.push(title='crashed', content=f"<{self.config_name}> GamePageUnknownError")
+            self.config.notifier.push(title=command, content=f"<{self.config_name}> GamePageUnknownError")
             exit(1)
             exit(1)
             return False
             return False
         except ScriptError as e:
         except ScriptError as e:
             logger.critical(e)
             logger.critical(e)
             logger.critical('This is likely to be a mistake of developers, but sometimes just random issues')
             logger.critical('This is likely to be a mistake of developers, but sometimes just random issues')
-            self.config.notifier.push(title='crashed', content=f"<{self.config_name}> ScriptError")
+            self.config.notifier.push(title=command, content=f"<{self.config_name}> ScriptError")
             exit(1)
             exit(1)
         except RequestHumanTakeover:
         except RequestHumanTakeover:
             logger.critical('Request human takeover')
             logger.critical('Request human takeover')
-            self.config.notifier.push(title='crashed', content=f"<{self.config_name}> RequestHumanTakeover")
+            self.config.notifier.push(title=command, content=f"<{self.config_name}> RequestHumanTakeover")
             exit(1)
             exit(1)
         except Exception as e:
         except Exception as e:
             logger.exception(e)
             logger.exception(e)
             self.save_error_log()
             self.save_error_log()
-            self.config.notifier.push(title='crashed', content=f"<{self.config_name}> Exception occured")
+            self.config.notifier.push(title=command, content=f"<{self.config_name}> Exception occured")
             exit(1)
             exit(1)
 
 
     def loop(self):
     def loop(self):

+ 1 - 1
tasks/Hyakkiyakou/prepare/get_images.py

@@ -25,7 +25,7 @@ class GenerateImages(GameUi, HyakkiyakouAssets):
     def run(self):
     def run(self):
         self.ui_get_current_page()
         self.ui_get_current_page()
         self.ui_goto(page_hyakkiyakou)
         self.ui_goto(page_hyakkiyakou)
-        for i in range(1):
+        for i in range(20):
             self.save_one()
             self.save_one()
 
 
     def save_one(self):
     def save_one(self):