Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KammererTob committed Sep 11, 2023
1 parent 95c5292 commit 9f9d83f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/stomp_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ class StompHandler {
_parser.escapeHeaders = false;
}

if (frame.headers['version'] != '1.0' && frame.headers.containsKey('heart-beat')) {
if (frame.headers['version'] != '1.0' &&
frame.headers.containsKey('heart-beat')) {
_setupHeartbeat(frame);
}

Expand Down Expand Up @@ -301,7 +302,8 @@ class StompHandler {
final ttl = max(config.heartbeatIncoming.inMilliseconds, serverOutgoing);
_heartbeatReceiver?.cancel();
_heartbeatReceiver = Timer.periodic(Duration(milliseconds: ttl), (_) {
final deltaMs = DateTime.now().millisecondsSinceEpoch - _lastServerActivity.millisecondsSinceEpoch;
final deltaMs = DateTime.now().millisecondsSinceEpoch -
_lastServerActivity.millisecondsSinceEpoch;
// The connection might be dead. Clean up.
if (deltaMs > (ttl * 2)) {
_cleanUp();
Expand Down
3 changes: 2 additions & 1 deletion test/stomp_handler_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ void main() {
handler!.dispose();
});

handler = StompHandler(config: config.copyWith(onConnect: onConnect))..start();
handler = StompHandler(config: config.copyWith(onConnect: onConnect))
..start();
});

test('disconnects correctly', () async {
Expand Down

0 comments on commit 9f9d83f

Please sign in to comment.