Skip to content

Commit f3054cf

Browse files
committed
refactor: remove handshake backoff logic to allow more immediate updates
1 parent 2dc735f commit f3054cf

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

lib/src/features/discovery/data/ble_discoverer.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class BLEDiscoverer {
2626
final Logger _log = Logger('BLEDiscoverer');
2727
final Map<int, BluetoothDevice> _syncQueue = {};
2828
final Map<int, DateTime> _lastSyncAttempt = {};
29-
final Map<int, DateTime> _lastHandshakeAttempt = {};
3029
final Set<int> _activeSyncs = {};
3130

3231
final StreamController<bool> _scanStatusController = StreamController.broadcast();
@@ -297,16 +296,8 @@ class BLEDiscoverer {
297296
Duration(milliseconds: 1000 + Random().nextInt(2000)),
298297
);
299298
_lastSyncAttempt[entry.key] = DateTime.now();
300-
301-
final lastHandshake = _lastHandshakeAttempt[entry.key];
302-
if (lastHandshake != null &&
303-
DateTime.now().difference(lastHandshake).inMinutes < 5) {
304-
_log.info('Skipping full sync for ${entry.key} due to backoff');
305-
continue;
306-
}
307299

308300
_activeSyncs.add(entry.key);
309-
_lastHandshakeAttempt[entry.key] = DateTime.now();
310301

311302
service.invoke('updateProgress', {
312303
'value': 1.0,

0 commit comments

Comments
 (0)