This commit is contained in:
xyj 2023-12-19 10:02:32 +08:00
parent 4cc6d3bb21
commit 7f8e58f80b
1 changed files with 5 additions and 1 deletions

View File

@ -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()