mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-11-11 15:07:32 +00:00
A broker that drops the session within a second had the service reconnecting every second indefinitely. Reconnects now back off from 5 seconds, doubling to a 5-minute cap, and reset after a session that stays up for a minute. "Connected" is logged only once the broker's CONNACK arrives rather than when the socket opens, the reconnect warning gives the reason and the paho disconnect code, and the client ID gets a random suffix so two bots started in the same second don't knock each other off. on_message runs on paho's network thread, where asyncio.create_task has no running loop, so every in-area strike raised and was swallowed at debug level. It now hands the strike to the bot's loop with run_coroutine_threadsafe. Fixes #362