service: Stop the timer more often
This commit is contained in:
parent
8d78c522f4
commit
4a56efc463
@ -55,16 +55,21 @@ class MoxxyReconnectionPolicy extends ReconnectionPolicy {
|
||||
|
||||
@override
|
||||
Future<void> reset() async {
|
||||
_stopTimer();
|
||||
await setIsReconnecting(false);
|
||||
}
|
||||
|
||||
@visibleForTesting
|
||||
Future<void> onTimerElapsed() async {
|
||||
void _stopTimer() {
|
||||
if (timer != null) {
|
||||
timer!.cancel();
|
||||
timer = null;
|
||||
_log.finest('Destroying timer');
|
||||
}
|
||||
}
|
||||
|
||||
@visibleForTesting
|
||||
Future<void> onTimerElapsed() async {
|
||||
_stopTimer();
|
||||
|
||||
_log.finest('Performing reconnect');
|
||||
await performReconnect!();
|
||||
|
Loading…
Reference in New Issue
Block a user