From 35cad26322699fc7ae9e14d3dd65aaf9bb8dd60a Mon Sep 17 00:00:00 2001 From: Urjith Mishra <66270347+TheScientist101@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:28:17 -0500 Subject: [PATCH] feat: remove plugins which do not report line numbers for high seas --- repositories/heartbeat.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/repositories/heartbeat.go b/repositories/heartbeat.go index 6f0fe043..d2896df4 100644 --- a/repositories/heartbeat.go +++ b/repositories/heartbeat.go @@ -49,6 +49,20 @@ func (r *HeartbeatRepository) InsertBatch(heartbeats []*models.Heartbeat) error return nil } + filteredHeartbeats := heartbeats[:0] + + for _, hb := range heartbeats { + if hb.Lines != 0 { + filteredHeartbeats = append(filteredHeartbeats, hb) + } + } + + heartbeats = filteredHeartbeats + + if len(heartbeats) == 0 { + return nil + } + if err := r.db. Clauses(clause.OnConflict{ DoNothing: true,