trackCommand registers the process with the server. If the server is closing, the process is not registered and should be closed. nolint:revive
(p *os.Process, add bool)
| 1167 | // |
| 1168 | //nolint:revive |
| 1169 | func (s *Server) trackProcess(p *os.Process, add bool) (ok bool) { |
| 1170 | s.mu.Lock() |
| 1171 | defer s.mu.Unlock() |
| 1172 | if add { |
| 1173 | if s.closing != nil { |
| 1174 | // Server closed. |
| 1175 | return false |
| 1176 | } |
| 1177 | s.wg.Add(1) |
| 1178 | s.processes[p] = struct{}{} |
| 1179 | return true |
| 1180 | } |
| 1181 | s.wg.Done() |
| 1182 | delete(s.processes, p) |
| 1183 | return true |
| 1184 | } |
| 1185 | |
| 1186 | // Close the server and all active connections. Server can be re-used |
| 1187 | // after Close is done. |
no test coverage detected