New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[openthermgateway] fix automatic reconnect after connection attempt fails #9965
Conversation
Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com>
Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com>
}, conf.connectionRetryInterval, TimeUnit.SECONDS); | ||
if (!explicitDisconnect && conf != null && conf.connectionRetryInterval > 0) { | ||
logger.debug("Scheduling to reconnect in {} seconds.", conf.connectionRetryInterval); | ||
scheduler.schedule(this::connect, conf.connectionRetryInterval, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A binding must not execute any task if it has been disposed. So, this task needs to be cancelled in dispose()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added cancelling task on dispose
Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/opentherm-gateway-binding/39160/204 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/opentherm-gateway-binding/39160/206 |
…ttempt fails (openhab#9965)" This reverts commit 5a7be93.
…ails (openhab#9965) * Added callback to disconnected() when connection attempt fails Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com> * Updated version number Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com> * Cancel reconnect task when disposing Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com> Signed-off-by: John Marshall <john.marshall.au@gmail.com>
…ails (openhab#9965) * Added callback to disconnected() when connection attempt fails Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com> * Updated version number Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com> * Cancel reconnect task when disposing Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com>
…ails (openhab#9965) * Added callback to disconnected() when connection attempt fails Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com> * Updated version number Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com> * Cancel reconnect task when disposing Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com>
Fixes #9903
Also see previously closed PR #9925
Signed-off-by: Arjen Korevaar a.korevaar@mephix.com