on_disconnect not work?
vvzvlad opened this issue · comments
In order to catch the problem with the connection, I use on_disconnect like this:
local function mqtt_disconnect_callback()
print("MQTT disconnect!")
end
local function mqtt_connect_callback()
print("MQTT connect!")
end
mqtt.wb:on_disconnect(mqtt_disconnect_callback)
mqtt.wb:on_connect(mqtt_connect_callback)
But in this case I get on_disconnect events about every second (together with on_connect). It seems to me that this is not the correct work of the subscription system for the disconnect event
2018-04-27 18:16:51.661 [61551] main/101/smart_sity_local.lua C> Tarantool 1.9.0-0-g14d33e3
2018-04-27 18:16:51.661 [61551] main/101/smart_sity_local.lua C> log level 4
2018-04-27 18:16:52.633 [61551] main C> entering the event loop
MQTT connect!
MQTT disconnect!
MQTT connect!
MQTT disconnect!
MQTT connect!
MQTT disconnect!
MQTT connect!
MQTT disconnect!
...
I guess, that you had a network issue. Can you retest this?
Thanks!
Yes, this seems to fix the problems