Interrupt current thread on InterruptedException (#12323)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2022-02-20 14:22:40 +01:00 committed by GitHub
parent 4d77608da1
commit c03dbfd520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -562,6 +562,9 @@ public class HDPowerViewWebTargets {
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");