update
This commit is contained in:
parent
2176473b76
commit
d96039460f
4
ceshi.py
4
ceshi.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue