update
This commit is contained in:
parent
4cc6d3bb21
commit
7f8e58f80b
6
tool.py
6
tool.py
|
@ -1,6 +1,7 @@
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import threading
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@ def get_list_record(client):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_record(msg, client):
|
def up(msg, client):
|
||||||
try:
|
try:
|
||||||
filename = json.loads(msg.payload.decode('utf-8'))["data"]
|
filename = json.loads(msg.payload.decode('utf-8'))["data"]
|
||||||
if filename is None or filename == '':
|
if filename is None or filename == '':
|
||||||
|
@ -114,3 +115,6 @@ def get_record(msg, client):
|
||||||
client.publish(info_topic, payload=publish_payload(code=200, msg=str(r)), qos=0)
|
client.publish(info_topic, payload=publish_payload(code=200, msg=str(r)), qos=0)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_record(msg, client):
|
||||||
|
threading.Thread(target=up, args=(msg, client)).start()
|
||||||
|
|
Loading…
Reference in New Issue