We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
your func:
func (c *StatsConnection) Disconnect() { if c == nil { return } if c.statsClient != nil { if err := c.statsClient.Disconnect(); err != nil { log.Debugf("disconnecting stats client failed: %v", err) } } close(c.connChan) close(c.done) }
in another fiber:
case <-c.done: log.Debugf("health check watcher closed") c.sendStatsConnEvent(ConnectionEvent{Timestamp: time.Now(), State: Disconnected, Error: nil}) return }
func sendStatsConnEvent:
func (c *StatsConnection) sendStatsConnEvent(event ConnectionEvent) { select { case c.connChan <- event: default: log.Warn("Stats connection state channel is full, discarding value.") } }
note this: case c.connChan <- event: now the c.connChan is cloed,then panic
case c.connChan <- event:
The text was updated successfully, but these errors were encountered:
ondrej-fabry
No branches or pull requests
your func:
in another fiber:
func sendStatsConnEvent:
note this:
case c.connChan <- event:
now the c.connChan is cloed,then panic
The text was updated successfully, but these errors were encountered: