Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/hotfix/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ impl<M: FixMessage, S: MessageStore> Session<M, S> {
self.logout_and_terminate("internal error").await;
}
}
} else {
} else if self.state.is_connected() {
// we are currently outside scheduled session time
self.initiate_graceful_logout("End of session time").await;
}
Expand Down
4 changes: 4 additions & 0 deletions crates/hotfix/src/session/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ impl SessionState {
}
}

pub fn is_connected(&self) -> bool {
self.get_writer().is_some()
}

pub fn try_transition_to_awaiting_logout(&mut self) -> bool {
if matches!(self, SessionState::AwaitingLogout { .. }) {
debug!("already in awaiting logout state");
Expand Down