-
Notifications
You must be signed in to change notification settings - Fork 316
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
Send Reset if the ResetTime elapsed in between checks #725
Conversation
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() { |
There was a problem hiding this comment.
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
internal/session_settings.go
Outdated
@@ -21,6 +21,7 @@ type SessionSettings struct { | |||
TimeZone *time.Location | |||
ResetSeqTime time.Time | |||
EnableResetSeqTime bool | |||
LastCheckedResetSeqTime time.Time |
There was a problem hiding this comment.
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
session_factory.go
Outdated
@@ -388,6 +388,7 @@ func (f sessionFactory) newSession( | |||
} | |||
s.EnableResetSeqTime = true | |||
s.ResetSeqTime = seqTime | |||
s.LastCheckedResetSeqTime = seqTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not belong here
No description provided.