diff --git a/conf/config.yaml b/conf/config.yaml index 509bf0e..c963557 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -4,5 +4,5 @@ SERVER: reconnect_interval: 3 VERSION: - code: 101 - name: 2.1.1 \ No newline at end of file + code: 102 + name: 2.1.2 \ No newline at end of file diff --git a/lib/_mqtt.py b/lib/_mqtt.py index 37a2fc0..5cba0c6 100644 --- a/lib/_mqtt.py +++ b/lib/_mqtt.py @@ -262,7 +262,7 @@ class MqttClient(mqtt.Client): return self.status def _send_pingreq(self): - self._ping_counter = self._ping_counter + 1 + self._ping_counter += 1 if self._ping_counter * 10 == 3600 * 4: print(threading.current_thread().name, '每隔4小时自动重连') self._ping_counter = 0 diff --git a/lib/control_server.py b/lib/control_server.py index 68fb653..90f196c 100644 --- a/lib/control_server.py +++ b/lib/control_server.py @@ -29,7 +29,7 @@ def post_terminal_info(name_f, source_ws_f, num_f, version_f, set_latest_f): _host = netutil.getip() data['ip'] = _host try: - r = requests.post(SERVER + '/post_terminal_info', json=data, timeout=2) + r = requests.post(SERVER + '/post_terminal_info', json=data, timeout=15) res= r.json().get('data', {}) new_ws =res.get('ws', data['ws']) set_latest_f(res['ver'])