Эх сурвалжийг харах

Merge pull request #1005 from BluettDream/dev_fix_schedule

fix: schedule not broadcast to oasx and branch not replace \n
huangrunheng 1 жил өмнө
parent
commit
434599e779

+ 1 - 1
module/server/updater.py

@@ -67,7 +67,7 @@ class Updater(DeployConfig, GitManager, PipManager):
         log : str = subprocess.run(
         log : str = subprocess.run(
             'git branch --show-current', capture_output=True, text=True, encoding="utf8", shell=True
             'git branch --show-current', capture_output=True, text=True, encoding="utf8", shell=True
         ).stdout
         ).stdout
-        log.replace('\n', '')
+        log = log.replace('\n', '')
         return log
         return log
 
 
     def current_commit(self) -> str:
     def current_commit(self) -> str:

+ 2 - 1
script.py

@@ -315,7 +315,6 @@ class Script:
 
 
             if task.next_run > datetime.now():
             if task.next_run > datetime.now():
                 logger.info(f'Wait until {task.next_run} for task `{task.command}`')
                 logger.info(f'Wait until {task.next_run} for task `{task.command}`')
-                # self.is_first_task = False
                 method = self.config.script.optimization.when_task_queue_empty
                 method = self.config.script.optimization.when_task_queue_empty
                 if method == 'close_game':
                 if method == 'close_game':
                     logger.info('Close game during wait')
                     logger.info('Close game during wait')
@@ -459,6 +458,8 @@ class Script:
                 continue
                 continue
 
 
             # Run
             # Run
+            if self.state_queue:
+                self.state_queue.put({"schedule": self.config.get_schedule_data()})
             logger.info(f'Scheduler: Start task `{task}`')
             logger.info(f'Scheduler: Start task `{task}`')
             self.device.stuck_record_clear()
             self.device.stuck_record_clear()
             self.device.click_record_clear()
             self.device.click_record_clear()