Exit well

This commit is contained in:
Owen
2025-07-24 20:46:33 -07:00
parent 008be54c55
commit 56377ec87e
3 changed files with 21 additions and 8 deletions

View File

@@ -119,7 +119,13 @@ func (s *Server) handleConnections() {
// Just a timeout, keep going
continue
}
logger.Error(s.outputPrefix+"Error reading from UDP: %v", err)
// Check if we're shutting down and the connection was closed
select {
case <-s.shutdownCh:
return // Don't log error if we're shutting down
default:
logger.Error(s.outputPrefix+"Error reading from UDP: %v", err)
}
continue
}