Skip to content

Commit

Permalink
chore: review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RRashmit committed Dec 5, 2024
1 parent 908f8dc commit 6c01ba0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/collector/otel_collector_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,12 @@ func (oc *Collector) updateTcplogReceivers(nginxConfigContext *model.NginxConfig
}
}

tcplogReceiverDeleted := oc.isNapReceiversDeleted(nginxConfigContext)
if !newTcplogReceiverAdded {
return tcplogReceiverDeleted
}
tcplogReceiverDeleted := oc.areNapReceiversDeleted(nginxConfigContext)

return newTcplogReceiverAdded
return newTcplogReceiverAdded || tcplogReceiverDeleted
}

func (oc *Collector) isNapReceiversDeleted(nginxConfigContext *model.NginxConfigContext) bool {
func (oc *Collector) areNapReceiversDeleted(nginxConfigContext *model.NginxConfigContext) bool {
listenAddressesToBeDeleted := oc.getConfigDeletedNapReceivers(nginxConfigContext)
if len(listenAddressesToBeDeleted) != 0 {
oc.deleteNapReceivers(listenAddressesToBeDeleted)
Expand Down

0 comments on commit 6c01ba0

Please sign in to comment.