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