File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -906,14 +906,16 @@ func (s *session) run() {
906906 }
907907
908908 })
909-
910- // Without this sleep the ticker will be aligned at the millisecond which
911- // corresponds to the creation of the session. If the session creation
912- // happened at 07:00:00.678 and the session StartTime is 07:30:00, any new
913- // connection received between 07:30:00.000 and 07:30:00.677 will be
914- // rejected. Aligning the ticker with a round second fixes that.
915- time .Sleep (time .Until (time .Now ().Truncate (time .Second ).Add (time .Second )))
916-
909+
910+ if s .SessionTime != nil {
911+ // Without this sleep the ticker will be aligned at the millisecond which
912+ // corresponds to the creation of the session. If the session creation
913+ // happened at 07:00:00.678 and the session StartTime is 07:30:00, any new
914+ // connection received between 07:30:00.000 and 07:30:00.677 will be
915+ // rejected. Aligning the ticker with a round second fixes that.
916+ time .Sleep (time .Until (time .Now ().Truncate (time .Second ).Add (time .Second )))
917+ }
918+
917919 ticker := time .NewTicker (time .Second )
918920
919921 defer func () {
You can’t perform that action at this time.
0 commit comments