Adding scheduled reconnection on timeout (#13130)

Signed-off-by: clinique <gael@lhopital.org>
This commit is contained in:
Gaël L'hopital 2022-07-16 23:15:05 +02:00 committed by GitHub
parent d724b7f075
commit 53b26809d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -142,7 +142,9 @@ public class OpenUVBridgeHandler extends BaseBridgeHandler {
logger.debug("{} : {}", statusMessage, jsonData);
}
} catch (IOException e) {
statusMessage = e.getMessage();
statusMessage = String.format("@text/offline.comm-error-ioexception [ \"%s\",\"%d\" ]", e.getMessage(),
RECONNECT_DELAY_MIN);
scheduleReconnectJob(RECONNECT_DELAY_MIN);
} catch (OpenUVException e) {
if (e.isQuotaError()) {
LocalDateTime nextMidnight = LocalDate.now().plusDays(1).atStartOfDay().plusMinutes(2);

View File

@ -67,6 +67,7 @@ offline.config-error-unknown-apikey = Parameter 'apikey' must be configured.
offline.config-error-invalid-refresh = Parameter 'refresh' must be higher than 3 minutes to stay in free API plan.
offline.comm-error-quota-exceeded = Quota Exceeded, going OFFLINE for today, will retry at : {0}
offline.comm-error-faultly-service = Service not responding, will reconnect in {0} minutes
offline.comm-error-ioexception = IOException : `{0}`, will reconnect in {1} minutes
offline.invalid-json = Invalid JSON received when calling `{0}`
offline.api-key-not-recognized = Service error while API key is known correct, will reconnect in {0} minutes