Skip to content
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

fix: stop timer #2516

Merged
merged 4 commits into from
Jul 30, 2024
Merged
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
3 changes: 3 additions & 0 deletions wsbroadcastserver/clientconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (cc *ClientConnection) Start(parentCtx context.Context) {
t := time.NewTimer(cc.delay)
select {
case <-ctx.Done():
t.Stop()
return
case <-t.C:
}
Expand Down Expand Up @@ -222,8 +223,10 @@ func (cc *ClientConnection) Start(parentCtx context.Context) {
timer := time.NewTimer(5 * time.Second)
select {
case <-ctx.Done():
timer.Stop()
return
case <-cc.registered:
timer.Stop()
log.Debug("ClientConnection registered with ClientManager", "client", cc.Name)
case <-timer.C:
log.Error("timed out waiting for ClientConnection to register with ClientManager", "client", cc.Name)
Expand Down
Loading