[bluetooth.airthings] Catch all exceptions in a scheduled task to prevent future executions from being suppressed (#12261)
* Fixes #9862 Catch all exceptions in scheduled task to prevent future executions from being suppressed. Signed-off-by: Pawel Switalski <switalski.pw@gmail.com> Signed-off-by: Pawel <s-pw@example.com>
This commit is contained in:
parent
baa9aacf50
commit
85866c63c0
@ -106,8 +106,12 @@ abstract public class AbstractAirthingsHandler extends BeaconBluetoothHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void executePeridioc() {
|
private void executePeridioc() {
|
||||||
sinceLastReadSec.addAndGet(CHECK_PERIOD_SEC);
|
try {
|
||||||
execute();
|
sinceLastReadSec.addAndGet(CHECK_PERIOD_SEC);
|
||||||
|
execute();
|
||||||
|
} catch (Exception e) { // catch all to avoid scheduleWithFixedDelay being suppressed
|
||||||
|
logger.warn("Failed to read Airthings device", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void execute() {
|
private synchronized void execute() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user