diff --git a/tool.py b/tool.py index 14fe518..7e64090 100755 --- a/tool.py +++ b/tool.py @@ -1,6 +1,7 @@ import json import os import subprocess +import threading import requests @@ -102,7 +103,7 @@ def get_list_record(client): pass -def get_record(msg, client): +def up(msg, client): try: filename = json.loads(msg.payload.decode('utf-8'))["data"] 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) except: pass + +def get_record(msg, client): + threading.Thread(target=up, args=(msg, client)).start()