From d45accfcada9582ff5c2555fc297af5505eda97e Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Thu, 14 Dec 2023 09:38:19 +0800 Subject: [PATCH] update --- MQTT.py | 3 +++ tool.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/MQTT.py b/MQTT.py index f25f625..863f190 100644 --- a/MQTT.py +++ b/MQTT.py @@ -55,6 +55,9 @@ class MQTTClient: elif data == "update": # git更新项目和配置文件 update(client) + elif data == "update": + # git更新项目和配置文件 + reload(client) elif data == "record_list": # 查看录像列表 get_list_record() diff --git a/tool.py b/tool.py index 37413e8..8466962 100755 --- a/tool.py +++ b/tool.py @@ -65,6 +65,11 @@ def update(client): client.publish('success', payload=json.dumps(output, ensure_ascii=False), qos=0) +def reload(client): + subprocess.Popen(['supervisorctl reload'], shell=True) + client.publish('success', payload="reloading", qos=0) + + def get_list_record(): data = { "data": os.listdir(mp4_path)