Просмотр исходного кода

fix(Config): Cannot show with the running task in OASX

ryland 2 лет назад
Родитель
Сommit
a7f34ebe61
3 измененных файлов с 3 добавлено и 3 удалено
  1. 1 0
      module/config/config.py
  2. 0 1
      module/server/script_process.py
  3. 2 2
      module/server/script_router.py

+ 1 - 0
module/config/config.py

@@ -209,6 +209,7 @@ class Config(ConfigState, ConfigManual, ConfigWatcher, ConfigMenu):
         if self.pending_task:
             logger.info(f"Pending tasks: {[f.command for f in self.pending_task]}")
             task = self.pending_task[0]
+            self.task = task
             logger.attr("Task", task)
             return task
 

+ 0 - 1
module/server/script_process.py

@@ -125,7 +125,6 @@ def func(config: str, state_queue: multiprocessing.Queue, log_pipe_in) -> None:
             logger.error(f'Error: {e}')
             raise
     start_log()
-    logger.hr(f'Script [{config}] process start')
     import time
     try:
         # while 1:

+ 2 - 2
module/server/script_router.py

@@ -138,7 +138,7 @@ async def websocket_endpoint(websocket: WebSocket, script_name: str):
     await script_process.connect(websocket)
     await script_process.broadcast_state({"state": script_process.state})
     config = mm.config_cache(script_name)
-    config.update_scheduler()
+    config.get_next()
     await script_process.broadcast_state({"schedule": config.get_schedule_data()})
 
     try:
@@ -149,7 +149,7 @@ async def websocket_endpoint(websocket: WebSocket, script_name: str):
                 await script_process.broadcast_state({"state": script_process.state})
             elif data == 'get_schedule':
                 config = mm.config_cache(script_name)
-                config.update_scheduler()
+                config.get_next()
                 await script_process.broadcast_state({"schedule": config.get_schedule_data()})
             elif data == 'start':
                 await script_process.start()