Skip to content

Commit

Permalink
fix(listen): timeout loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jul 11, 2024
1 parent 71810f1 commit ce82138
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gold/link/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ func (m *Me) listenudp() (conn *net.UDPConn, err error) {
if err != nil {
logrus.Warnln("[listen] set ddl err:", err)
}
READ:
n, addr, err := conn.ReadFromUDP(lbf)
if m.loop == nil {
logrus.Warnln("[listen] quit listening")
return
}
if errors.Is(err, os.ErrDeadlineExceeded) {
err = nil

Check failure on line 64 in gold/link/listen.go

View workflow job for this annotation

GitHub Actions / Lint

ineffectual assignment to err (ineffassign)

Check failure on line 64 in gold/link/listen.go

View workflow job for this annotation

GitHub Actions / Lint

ineffectual assignment to err (ineffassign)
goto READ
}
if err != nil {
logrus.Warnln("[listen] read from udp err, reconnect:", err)
Expand Down

0 comments on commit ce82138

Please sign in to comment.