Parcourir la source

fix(Script): There are three errors, close the emulator. Default is False

Gan1Ser il y a 1 an
Parent
commit
95856febac
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 2 1
      script.py
  2. 2 0
      tasks/Script/config_error.py

+ 2 - 1
script.py

@@ -489,7 +489,8 @@ class Script:
                     content=f"<{self.config_name}> 任务连续失败三次,请上线查看"
                 )
                 # 关闭模拟器
-                self.device.emulator_stop()
+                if self.config.script.error.error_repeated:
+                    self.device.emulator_stop()
                 exit(1)
 
             if success:

+ 2 - 0
tasks/Script/config_error.py

@@ -10,6 +10,8 @@ from module.logger import logger
 class Error(BaseModel):
     handle_error: bool = Field(default=True,
                                description='handle_error_help')
+    error_repeated: bool = Field(default=False,
+                               description='是否多次出错关闭模拟器')
     save_error: bool = Field(default=True,
                              description='')
     screenshot_length: int = Field(default=1,