]> git.basschouten.com Git - openhab-addons.git/commitdiff
[rotel] Fix handling of InterruptedException (Thread.sleep) (#10460)
authorlolodomo <lg.hc@free.fr>
Mon, 5 Apr 2021 13:14:11 +0000 (15:14 +0200)
committerGitHub <noreply@github.com>
Mon, 5 Apr 2021 13:14:11 +0000 (15:14 +0200)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java

index d2fb766920bbf7fd7afb9fbd6b9d0034a383a138..062c1ad6b36e40fd1ed8218d53d904a16cd40d95 100644 (file)
@@ -858,6 +858,7 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL
                 scheduleReconnectJob();
             } catch (InterruptedException e) {
                 logger.debug("Command {} from channel {} interrupted: {}", command, channel, e.getMessage());
+                Thread.currentThread().interrupt();
             }
         }
     }
@@ -1686,6 +1687,7 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL
                     closeConnection();
                 } catch (InterruptedException e) {
                     logger.debug("Init sequence interrupted: {}", e.getMessage());
+                    Thread.currentThread().interrupt();
                 }
             }
         }, 2500, TimeUnit.MILLISECONDS);
@@ -1729,6 +1731,7 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL
                     closeConnection();
                 } catch (InterruptedException e) {
                     logger.debug("Init sequence zone 2 interrupted: {}", e.getMessage());
+                    Thread.currentThread().interrupt();
                 }
             }
         }, 2500, TimeUnit.MILLISECONDS);
@@ -1772,6 +1775,7 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL
                     closeConnection();
                 } catch (InterruptedException e) {
                     logger.debug("Init sequence zone 3 interrupted: {}", e.getMessage());
+                    Thread.currentThread().interrupt();
                 }
             }
         }, 2500, TimeUnit.MILLISECONDS);
@@ -1815,6 +1819,7 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL
                     closeConnection();
                 } catch (InterruptedException e) {
                     logger.debug("Init sequence zone 4 interrupted: {}", e.getMessage());
+                    Thread.currentThread().interrupt();
                 }
             }
         }, 2500, TimeUnit.MILLISECONDS);