This commit is contained in:
xyj 2023-12-05 16:51:10 +08:00
parent 2176473b76
commit d96039460f
1 changed files with 2 additions and 2 deletions

View File

@ -16,13 +16,13 @@ def on_connect(client, userdata, flags, rc):
global times
if rc == 0:
print("连接成功,执行数据推送和本地存储")
subprocess.Popen(["supervisorctl stop sensor_to_local && supervisorctl start sensor_to_server"])
subprocess.Popen(["supervisorctl stop sensor_to_local && supervisorctl start sensor_to_server"], shell=True)
times = 3
def on_connect_fail(client, userdata):
print("失败,执行本地存储")
subprocess.Popen(["supervisorctl stop sensor_to_server && supervisorctl start sensor_to_local"])
subprocess.Popen(["supervisorctl stop sensor_to_server && supervisorctl start sensor_to_local"], shell=True)
times = 3