|
@@ -138,7 +138,7 @@ async def websocket_endpoint(websocket: WebSocket, script_name: str):
|
|
|
script_process = mm.script_process[script_name]
|
|
script_process = mm.script_process[script_name]
|
|
|
await script_process.connect(websocket)
|
|
await script_process.connect(websocket)
|
|
|
await script_process.broadcast_state({"state": script_process.state})
|
|
await script_process.broadcast_state({"state": script_process.state})
|
|
|
- mm.ensure_config_cache(script_name)
|
|
|
|
|
|
|
+ mm.ensure_config_cache(script_name, reload=True)
|
|
|
mm.config_cache.update_scheduler()
|
|
mm.config_cache.update_scheduler()
|
|
|
await script_process.broadcast_state({"schedule": mm.config_cache.get_schedule_data()})
|
|
await script_process.broadcast_state({"schedule": mm.config_cache.get_schedule_data()})
|
|
|
|
|
|
|
@@ -147,9 +147,9 @@ async def websocket_endpoint(websocket: WebSocket, script_name: str):
|
|
|
# 初次进入,广播state schedule
|
|
# 初次进入,广播state schedule
|
|
|
data = await websocket.receive_text()
|
|
data = await websocket.receive_text()
|
|
|
if data == 'get_state':
|
|
if data == 'get_state':
|
|
|
- await script_process.broadcast_state({"state":script_process.state})
|
|
|
|
|
|
|
+ await script_process.broadcast_state({"state": script_process.state})
|
|
|
elif data == 'get_schedule':
|
|
elif data == 'get_schedule':
|
|
|
- mm.ensure_config_cache(script_name)
|
|
|
|
|
|
|
+ mm.ensure_config_cache(script_name, reload=True)
|
|
|
mm.config_cache.update_scheduler()
|
|
mm.config_cache.update_scheduler()
|
|
|
await script_process.broadcast_state({"schedule":mm.config_cache.get_schedule_data()})
|
|
await script_process.broadcast_state({"schedule":mm.config_cache.get_schedule_data()})
|
|
|
elif data == 'start':
|
|
elif data == 'start':
|