update
This commit is contained in:
parent
7a6f33fcac
commit
d45accfcad
3
MQTT.py
3
MQTT.py
|
@ -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()
|
||||||
|
|
5
tool.py
5
tool.py
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue