File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
internal/sms-gateway/modules/sse Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,9 @@ func (s *Service) removeConnection(deviceID, connID string) {
226226 if conn .id == connID {
227227 close (conn .closeSignal )
228228 s .connections [deviceID ] = append (connections [:i ], connections [i + 1 :]... )
229+
230+ // Decrement active connections metric
231+ s .metrics .DecrementActiveConnections ()
229232 s .logger .Info (
230233 "Removing SSE connection" ,
231234 zap .String ("device_id" , deviceID ),
@@ -235,9 +238,6 @@ func (s *Service) removeConnection(deviceID, connID string) {
235238 }
236239 }
237240
238- // Decrement active connections metric
239- s .metrics .DecrementActiveConnections ()
240-
241241 if len (s .connections [deviceID ]) == 0 {
242242 delete (s .connections , deviceID )
243243 }
You can’t perform that action at this time.
0 commit comments