This commit is contained in:
xyj 2023-12-14 09:38:19 +08:00
parent 7a6f33fcac
commit d45accfcad
2 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,9 @@ class MQTTClient:
elif data == "update": elif data == "update":
# git更新项目和配置文件 # git更新项目和配置文件
update(client) update(client)
elif data == "update":
# git更新项目和配置文件
reload(client)
elif data == "record_list": elif data == "record_list":
# 查看录像列表 # 查看录像列表
get_list_record() get_list_record()

View File

@ -65,6 +65,11 @@ def update(client):
client.publish('success', payload=json.dumps(output, ensure_ascii=False), qos=0) 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(): def get_list_record():
data = { data = {
"data": os.listdir(mp4_path) "data": os.listdir(mp4_path)