(id string)
| 159 | } |
| 160 | |
| 161 | func (s *Server) markInFlight(id string) (exists bool, cleanup func()) { |
| 162 | s.inFlightMu.Lock() |
| 163 | defer s.inFlightMu.Unlock() |
| 164 | |
| 165 | _, ok := s.inFlight[id] |
| 166 | if ok { |
| 167 | return true, func() {} |
| 168 | } |
| 169 | s.inFlight[id] = struct{}{} |
| 170 | |
| 171 | return false, func() { |
| 172 | s.inFlightMu.Lock() |
| 173 | delete(s.inFlight, id) |
| 174 | s.inFlightMu.Unlock() |
| 175 | } |
| 176 | } |
no outgoing calls
no test coverage detected