Skip to content

Commit c30a231

Browse files
authored
Attemmpt to fix warning about shutdownNow (openhab#20285)
Signed-off-by: Paul Smedley <paul@smedley.id.au>
1 parent 1b2575e commit c30a231

File tree

1 file changed

+3
-8
lines changed
  • bundles/org.openhab.binding.ring/src/main/java/org/openhab/binding/ring/internal/handler

1 file changed

+3
-8
lines changed

bundles/org.openhab.binding.ring/src/main/java/org/openhab/binding/ring/internal/handler/AccountHandler.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.List;
2525
import java.util.Map;
2626
import java.util.Set;
27-
import java.util.concurrent.ExecutorService;
27+
import java.util.concurrent.ScheduledExecutorService;
2828
import java.util.concurrent.ScheduledFuture;
2929
import java.util.concurrent.TimeUnit;
3030

@@ -107,7 +107,7 @@ public class AccountHandler extends BaseBridgeHandler implements RingAccount {
107107
*/
108108
private int eventIndex = 0;
109109

110-
private @Nullable ExecutorService videoExecutorService;
110+
private @Nullable ScheduledExecutorService videoExecutorService;
111111

112112
/*
113113
* The number of video files to keep when auto-downloading
@@ -444,7 +444,7 @@ protected void eventTick() {
444444
updateState(CHANNEL_EVENT_DOORBOT_ID, new StringType(lastEvents.getFirst().doorbot.id));
445445
updateState(CHANNEL_EVENT_DOORBOT_DESCRIPTION,
446446
new StringType(lastEvents.getFirst().doorbot.description));
447-
ExecutorService service = videoExecutorService;
447+
ScheduledExecutorService service = videoExecutorService;
448448
if (service != null) {
449449
service.submit(() -> getVideo(lastEvents.getFirst()));
450450
}
@@ -545,11 +545,6 @@ public void dispose() {
545545

546546
stopSessionRefresh();
547547
stopAutomaticRefresh();
548-
ExecutorService service = this.videoExecutorService;
549-
if (!service.isShutdown()) {
550-
service.shutdownNow();
551-
}
552-
this.videoExecutorService = null;
553548
super.dispose();
554549
}
555550

0 commit comments

Comments
 (0)