Skip to content

Commit

Permalink
Interrupt current thread on InterruptedException (openhab#12323)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
  • Loading branch information
jlaur authored and NickWaterton committed Apr 27, 2022
1 parent c223580 commit 1484d0b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,9 @@ private synchronized String invoke(HttpMethod method, String url, @Nullable Quer
try {
response = request.send();
} catch (InterruptedException | TimeoutException | ExecutionException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
if (Instant.now().isBefore(maintenanceScheduledEnd)) {
// throw "softer" exception during maintenance window
logger.debug("Hub still undergoing maintenance");
Expand Down

0 comments on commit 1484d0b

Please sign in to comment.