Explorar o código

fix: schedule not broadcast to oasx and branch not replace \n

(cherry picked from commit 43e9f62d6772edc6c43483fdfd051899c6b8ba06)
Azure hai 1 ano
pai
achega
2083f64545
Modificáronse 2 ficheiros con 3 adicións e 2 borrados
  1. 1 1
      module/server/updater.py
  2. 2 1
      script.py

+ 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

@@ -308,7 +308,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')
@@ -437,6 +436,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()