Skip to content

Send Reset if the ResetTime elapsed in between checks #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 7, 2025

Conversation

JackChalmers
Copy link
Contributor

No description provided.

session_state.go Outdated
session.ResetSeqTime.Minute() == now.Minute() &&
session.ResetSeqTime.Second() == now.Second() {
// If we have crossed the reset time boundary in between checks, we send the reset
if session.LastCheckedResetSeqTime.Before(session.ResetSeqTime) && now.After(session.ResetSeqTime) && session.stateMachine.State.IsConnected() {
Copy link
Contributor

@michaelwilner michaelwilner Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work. The session.ResetSeqTime, when parsed with the short form string in the session factory, will correspond to the time of the parse only. It will not reflect "today's" reset seq time.

In addition, the last checked reset seq time should be initialized to zero, so this method needs to ensure that the last checked reset seq time must have been set previously before passing this condition

@@ -21,6 +21,7 @@ type SessionSettings struct {
TimeZone *time.Location
ResetSeqTime time.Time
EnableResetSeqTime bool
LastCheckedResetSeqTime time.Time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a session settings struct and this variable does not belong here

@@ -388,6 +388,7 @@ func (f sessionFactory) newSession(
}
s.EnableResetSeqTime = true
s.ResetSeqTime = seqTime
s.LastCheckedResetSeqTime = seqTime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not belong here

@michaelwilner michaelwilner merged commit a101c32 into quickfixgo:main Aug 7, 2025
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants