Disable $SYS when 'sys_interval' is set to 0 (required) for paho tests

HBMQTT-26
pull/8/head
Nicolas Jouanin 2015-08-13 21:30:09 +02:00
rodzic c1423ff078
commit 0ce7bea6ef
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -234,11 +234,11 @@ class Broker:
self._servers[listener_name] = Server(listener_name, instance, max_connections, self._loop)
# Start $SYS topics management
self._init_dollar_sys()
try:
sys_interval = int(self.config['sys_interval'])
if sys_interval:
sys_interval = int(self.config.get('sys_interval', 0))
if sys_interval > 0:
self.logger.debug("Setup $SYS broadcasting every %d secondes" % sys_interval)
self._init_dollar_sys()
self.sys_handle = self._loop.call_later(sys_interval, self.broadcast_dollar_sys_topics)
except KeyError:
pass

Wyświetl plik

@ -18,7 +18,7 @@ config = {
'type': 'ws'
},
},
'sys_interval': 10,
'sys_interval': 0,
}
broker = Broker(config)