Skip to content

Commit 246b7b3

Browse files
committed
store: reset backoff on success
Fixes: zulip#554
1 parent 34f1a4d commit 246b7b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/model/store.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,6 @@ class UpdateMachine {
694694
assert(debugLog('Transient error polling event queue for $store: $e\n'
695695
'Backing off, then will retry…'));
696696
// TODO tell user if transient polling errors persist
697-
// TODO reset to short backoff eventually
698697
await backoffMachine.wait();
699698
assert(debugLog('… Backoff wait complete, retrying poll.'));
700699
continue;
@@ -716,6 +715,9 @@ class UpdateMachine {
716715
if (events.isNotEmpty) {
717716
lastEventId = events.last.id;
718717
}
718+
719+
// On success, reset the backoff.
720+
backoffMachine.reset();
719721
}
720722
}
721723

0 commit comments

Comments
 (0)